()
| 14 | } |
| 15 | |
| 16 | fn is_sudo_available() -> bool { |
| 17 | Command::new("sudo") |
| 18 | .arg("--version") |
| 19 | .stdout(Stdio::null()) |
| 20 | .stderr(Stdio::null()) |
| 21 | .status() |
| 22 | .map(|status| status.success()) |
| 23 | .unwrap_or(false) |
| 24 | } |
| 25 | |
| 26 | /// Whether `sudo` can run without prompting for a password (passwordless rule or |
| 27 | /// a cached, still-valid credential). Used to decide whether a command can be |
no test coverage detected