added silent install option for winget (#1089)

* added silent install option for winget

* corrected formatting issues.

* Update src/steps/os/windows.rs

Remove code duplication.

Co-authored-by: SteveLauC <stevelauc@outlook.com>

---------

Co-authored-by: SteveLauC <stevelauc@outlook.com>
This commit is contained in:
Red Wizard
2025-03-30 09:11:04 -04:00
committed by GitHub
parent a4a2d52a6d
commit a601d8429d
3 changed files with 19 additions and 4 deletions

View File

@@ -42,10 +42,12 @@ pub fn run_winget(ctx: &ExecutionContext) -> Result<()> {
print_separator("winget");
ctx.run_type()
.execute(winget)
.args(["upgrade", "--all"])
.status_checked()
let mut args = vec!["upgrade", "--all"];
if ctx.config().winget_silent_install() {
args.push("--silent");
}
ctx.run_type().execute(winget).args(args).status_checked()
}
pub fn run_scoop(ctx: &ExecutionContext) -> Result<()> {