Add cleanup support for scoop (fix #311)

This commit is contained in:
Roey Darwish Dror
2020-01-30 20:32:37 +02:00
parent 02692bd5e1
commit b91fa4e26c
2 changed files with 14 additions and 3 deletions

View File

@@ -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(),
)?;
}
}

View File

@@ -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<()> {