Chocolatey (#34)

This commit is contained in:
Roey Darwish Dror
2018-06-28 07:47:51 +03:00
parent c667e224a6
commit c16865da76
2 changed files with 19 additions and 0 deletions

View File

@@ -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)]

View File

@@ -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")