diff --git a/src/operations/clean.rs b/src/operations/clean.rs index dcbfcbb..fe865c1 100644 --- a/src/operations/clean.rs +++ b/src/operations/clean.rs @@ -1,5 +1,3 @@ -use tokio::process::Command; - use crate::crash; use crate::internal::commands::ShellCommand; @@ -109,15 +107,16 @@ pub async fn clean(options: Options) { tracing::debug!("Clearing using `paccache -r`"); // Clear pacman's cache (keeping latest 3 versions of installed packages) - Command::new(config::read().bin.sudo.unwrap_or_default()) + ShellCommand::sudo() .arg("paccache") .args(paccache_args) - .spawn() + .elevated() + .spawn(true) .unwrap_or_else(|e| { crash!( AppExitCode::PacmanError, "Couldn't clear cache using `paccache -r`, {}", - e, + e ) }) .wait()