Automatically detect gsudo (#469)

This commit is contained in:
Roey Darwish Dror
2020-07-10 11:21:19 +03:00
committed by GitHub
parent 69b9c4b24c
commit 065565240e
5 changed files with 15 additions and 38 deletions

View File

@@ -14,7 +14,6 @@ pub struct ExecutionContext<'a> {
}
impl<'a> ExecutionContext<'a> {
#[cfg(unix)]
pub fn new(
run_type: RunType,
sudo: &'a Option<PathBuf>,
@@ -31,17 +30,6 @@ impl<'a> ExecutionContext<'a> {
}
}
#[cfg(not(unix))]
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,
}
}
pub fn run_type(&self) -> RunType {
self.run_type
}