MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / is_sudo_available

Function is_sudo_available

src/executor/helpers/run_with_sudo.rs:16–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14}
15
16fn 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

Callers 2

wrap_with_sudoFunction · 0.85

Calls 1

argMethod · 0.80

Tested by

no test coverage detected