Allow tlmgr to run in Linux (fix #406)

This commit is contained in:
Roey Darwish Dror
2020-06-03 22:12:27 +03:00
committed by GitHub
parent 89578a7fd9
commit 98657edb60
5 changed files with 27 additions and 17 deletions

View File

@@ -3,12 +3,10 @@ use crate::config::Config;
use crate::executor::RunType;
use crate::git::Git;
use directories::BaseDirs;
#[cfg(unix)]
use std::path::PathBuf;
pub struct ExecutionContext<'a> {
run_type: RunType,
#[cfg(unix)]
sudo: &'a Option<PathBuf>,
git: &'a Git,
config: &'a Config,
@@ -37,6 +35,7 @@ impl<'a> ExecutionContext<'a> {
pub fn new(run_type: RunType, git: &'a Git, config: &'a Config, base_dirs: &'a BaseDirs) -> ExecutionContext<'a> {
ExecutionContext {
run_type,
sudo: &None,
config,
git,
base_dirs,
@@ -51,7 +50,6 @@ impl<'a> ExecutionContext<'a> {
&self.git
}
#[cfg(unix)]
pub fn sudo(&self) -> &Option<PathBuf> {
&self.sudo
}