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

@@ -87,9 +87,8 @@ pub fn which<T: AsRef<OsStr> + Debug>(binary_name: T) -> Option<PathBuf> {
}
}
#[cfg(unix)]
pub fn sudo() -> Option<PathBuf> {
which("sudo").or_else(|| which("pkexec"))
which("sudo").or_else(|| which("gsudo")).or_else(|| which("pkexec"))
}
pub fn editor() -> Vec<String> {