From 228a13118570eb9bca6ed6b2fe37a3f7916784ab Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Thu, 7 Jun 2018 22:36:32 +0300 Subject: [PATCH] Rustfmt (fixes #16) --- src/main.rs | 5 +++++ src/steps.rs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/main.rs b/src/main.rs index cc9a503e..589eef5d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -100,6 +100,11 @@ fn main() -> Result<(), Error> { } } + if let Ok(rustup) = which("rustup") { + terminal.print_separator("rustup"); + run_rustup(&rustup).report("rustup", &mut reports); + } + let cargo_upgrade = home_path(".cargo/bin/cargo-install-update"); if cargo_upgrade.exists() { terminal.print_separator("Cargo"); diff --git a/src/steps.rs b/src/steps.rs index 1bddef2f..569792b0 100644 --- a/src/steps.rs +++ b/src/steps.rs @@ -119,6 +119,12 @@ pub fn run_fwupdmgr(fwupdmgr: &PathBuf) -> Result<(), failure::Error> { Ok(()) } +pub fn run_rustup(rustup: &PathBuf) -> Result<(), failure::Error> { + Command::new(rustup).arg("update").spawn()?.wait()?.check()?; + + Ok(()) +} + pub fn upgrade_macos() -> Result<(), failure::Error> { Command::new("softwareupdate") .args(&["--install", "--all"])