Files
topgrade/src/macos.rs

21 lines
502 B
Rust
Raw Normal View History

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;
use std::process::Command;
2018-08-19 14:45:23 +03:00
#[must_use]
2018-08-22 16:40:39 +03:00
pub fn upgrade_macos(terminal: &mut Terminal) -> 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> {
Command::new("softwareupdate")
.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
}