refactor: make update fn take &ExectionContext & put update fn together (#457)

This commit is contained in:
SteveLauC
2023-06-03 04:20:42 +08:00
committed by GitHub
parent a0ff565220
commit 658829e4ff
5 changed files with 157 additions and 174 deletions

View File

@@ -53,7 +53,7 @@ pub fn run_winget(ctx: &ExecutionContext) -> Result<()> {
.status_checked()
}
pub fn run_scoop(cleanup: bool, ctx: &ExecutionContext) -> Result<()> {
pub fn run_scoop(ctx: &ExecutionContext) -> Result<()> {
let scoop = require("scoop")?;
print_separator("Scoop");
@@ -61,7 +61,7 @@ pub fn run_scoop(cleanup: bool, ctx: &ExecutionContext) -> Result<()> {
ctx.run_type().execute(&scoop).args(["update"]).status_checked()?;
ctx.run_type().execute(&scoop).args(["update", "*"]).status_checked()?;
if cleanup {
if ctx.config().cleanup() {
ctx.run_type().execute(&scoop).args(["cleanup", "*"]).status_checked()?;
}