diff --git a/src/main.rs b/src/main.rs index cdec4c39..d78c573d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -184,7 +184,12 @@ fn run() -> Result<()> { config.no_retry(), )?; - execute(&mut report, "Scoop", || windows::run_scoop(run_type), config.no_retry())?; + execute( + &mut report, + "Scoop", + || windows::run_scoop(config.cleanup(), run_type), + config.no_retry(), + )?; } } diff --git a/src/steps/os/windows.rs b/src/steps/os/windows.rs index 5fad23a0..aaf4b5f1 100644 --- a/src/steps/os/windows.rs +++ b/src/steps/os/windows.rs @@ -12,13 +12,19 @@ pub fn run_chocolatey(run_type: RunType) -> Result<()> { run_type.execute(&choco).args(&["upgrade", "all"]).check_run() } -pub fn run_scoop(run_type: RunType) -> Result<()> { +pub fn run_scoop(cleanup: bool, run_type: RunType) -> Result<()> { let scoop = require("scoop")?; print_separator("Scoop"); run_type.execute(&scoop).args(&["update"]).check_run()?; - run_type.execute(&scoop).args(&["update", "*"]).check_run() + run_type.execute(&scoop).args(&["update", "*"]).check_run()?; + + if cleanup { + run_type.execute(&scoop).args(&["cleanup", "*"]).check_run()?; + } + + Ok(()) } pub fn run_wsl_topgrade(run_type: RunType) -> Result<()> {