Add pre_sudo option (#219)

* Add `pre_sudo` option
This commit is contained in:
Rebecca Turner
2022-11-24 14:15:43 -05:00
committed by GitHub
parent f2c7e4848e
commit e456155562
6 changed files with 54 additions and 9 deletions

View File

@@ -67,13 +67,6 @@ pub fn which<T: AsRef<OsStr> + Debug>(binary_name: T) -> Option<PathBuf> {
}
}
pub fn sudo() -> Option<PathBuf> {
which("doas")
.or_else(|| which("sudo"))
.or_else(|| which("gsudo"))
.or_else(|| which("pkexec"))
}
pub fn editor() -> Vec<String> {
env::var("EDITOR")
.unwrap_or_else(|_| String::from(if cfg!(windows) { "notepad" } else { "vi" }))