2018-08-26 16:12:59 +03:00
|
|
|
use super::executor::Executor;
|
2018-08-19 14:45:23 +03:00
|
|
|
use super::terminal::Terminal;
|
2018-06-28 12:16:54 +03:00
|
|
|
use super::utils::Check;
|
|
|
|
|
use failure;
|
|
|
|
|
|
2018-08-19 14:45:23 +03:00
|
|
|
#[must_use]
|
2018-08-26 16:12:59 +03:00
|
|
|
pub fn upgrade_macos(terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
|
2018-08-19 14:45:23 +03:00
|
|
|
terminal.print_separator("App Store");
|
|
|
|
|
|
2018-08-22 16:40:39 +03:00
|
|
|
let success = || -> Result<(), failure::Error> {
|
2018-08-26 16:12:59 +03:00
|
|
|
Executor::new("softwareupdate", dry_run)
|
2018-08-22 16:40:39 +03:00
|
|
|
.args(&["--install", "--all"])
|
|
|
|
|
.spawn()?
|
|
|
|
|
.wait()?
|
|
|
|
|
.check()?;
|
|
|
|
|
Ok(())
|
|
|
|
|
}().is_ok();
|
2018-06-28 12:16:54 +03:00
|
|
|
|
2018-08-22 16:40:39 +03:00
|
|
|
Some(("App Store", success))
|
2018-06-28 12:16:54 +03:00
|
|
|
}
|