diff --git a/src/commands.rs b/src/commands.rs index 124e43a..ba00f1e 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -63,11 +63,12 @@ impl Command { pub fn run(&self) -> Result<()> { let cmd = if self.elevate { - let mut cmd = Exec::cmd("sudo"); + #[cfg(not(target_os = "macos"))] + let cmd = Exec::cmd("sudo"); // Check for if sudo has the preserve-env flag #[cfg(target_os = "macos")] - cmd = cmd.args( + let cmd = Exec::cmd("sudo").args( if Exec::cmd("sudo") .args(&["--help"]) .stderr(Redirection::None)