From 58c471a9d9accf9f3de25aa7ea2ee60865f62f0c Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Wed, 22 Aug 2018 16:40:39 +0300 Subject: [PATCH] Really fix macOS --- src/macos.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/macos.rs b/src/macos.rs index 464cc913..72f836a5 100644 --- a/src/macos.rs +++ b/src/macos.rs @@ -4,14 +4,17 @@ use failure; use std::process::Command; #[must_use] -pub fn upgrade_macos(terminal: &mut Terminal) -> Result<(), failure::Error> { +pub fn upgrade_macos(terminal: &mut Terminal) -> Option<(&'static str, bool)> { terminal.print_separator("App Store"); - Command::new("softwareupdate") - .args(&["--install", "--all"]) - .spawn()? - .wait()? - .check()?; + let success = || -> Result<(), failure::Error> { + Command::new("softwareupdate") + .args(&["--install", "--all"]) + .spawn()? + .wait()? + .check()?; + Ok(()) + }().is_ok(); - Ok(()) + Some(("App Store", success)) }