diff --git a/src/main.rs b/src/main.rs index d6c36690..826331be 100644 --- a/src/main.rs +++ b/src/main.rs @@ -137,6 +137,14 @@ fn run() -> Result<(), Error> { run_homebrew(&brew).report("Brew", &mut reports); } + #[cfg(windows)] + { + if let Some(choco) = utils::which("choco") { + terminal.print_separator("Chocolatey"); + run_chocolatey(&choco).report("Chocolatey", &mut reports); + } + } + git_repos.insert(home_path(".emacs.d")); #[cfg(unix)] diff --git a/src/steps.rs b/src/steps.rs index d638b5a8..9cdd10b1 100644 --- a/src/steps.rs +++ b/src/steps.rs @@ -141,6 +141,17 @@ pub fn upgrade_macos() -> Result<(), failure::Error> { Ok(()) } +#[cfg(windows)] +pub fn run_chocolatey(choco: &PathBuf) -> Result<(), failure::Error> { + Command::new(&choco) + .args(&["upgrade", "all"]) + .spawn()? + .wait()? + .check()?; + + Ok(()) +} + pub fn run_homebrew(homebrew: &PathBuf) -> Result<(), failure::Error> { Command::new(&homebrew) .arg("update")