Support winget (fix #721) (#722)

This commit is contained in:
Roey Darwish Dror
2021-06-03 13:08:17 +03:00
committed by GitHub
parent 6194eede5a
commit 9205649a5f
3 changed files with 10 additions and 0 deletions

View File

@@ -117,6 +117,7 @@ pub enum Step {
Vagrant,
Vcpkg,
Vim,
Winget,
Wsl,
Yadm,
}

View File

@@ -147,6 +147,7 @@ fn run() -> Result<()> {
{
runner.execute(Step::Chocolatey, "Chocolatey", || windows::run_chocolatey(&ctx))?;
runner.execute(Step::Scoop, "Scoop", || windows::run_scoop(config.cleanup(), run_type))?;
runner.execute(Step::Winget, "Winget", || windows::run_winget(&ctx))?;
}
#[cfg(target_os = "macos")]

View File

@@ -35,6 +35,14 @@ pub fn run_chocolatey(ctx: &ExecutionContext) -> Result<()> {
command.check_run()
}
pub fn run_winget(ctx: &ExecutionContext) -> Result<()> {
let winget = require("winget")?;
print_separator("winget");
ctx.run_type().execute(&winget).args(&["upgrade", "--all"]).check_run()
}
pub fn run_scoop(cleanup: bool, run_type: RunType) -> Result<()> {
let scoop = require("scoop")?;