Files
topgrade/src/macos.rs

21 lines
504 B
Rust
Raw Normal View History

2018-08-26 16:12:59 +03:00
use super::executor::Executor;
2018-12-05 11:34:08 +02:00
use super::terminal::print_separator;
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-12-05 11:34:08 +02:00
pub fn upgrade_macos(dry_run: bool) -> Option<(&'static str, bool)> {
print_separator("App Store");
2018-08-19 14:45:23 +03:00
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
}