2018-12-15 21:52:21 +02:00
|
|
|
use crate::error::Error;
|
|
|
|
|
use crate::executor::Executor;
|
|
|
|
|
use crate::terminal::print_separator;
|
|
|
|
|
use crate::utils::Check;
|
2018-06-28 12:16:54 +03:00
|
|
|
|
2018-08-19 14:45:23 +03:00
|
|
|
#[must_use]
|
2018-12-31 13:26:17 +02:00
|
|
|
pub fn upgrade_macos(run_type: RunType) -> Option<(&'static str, bool)> {
|
2018-12-05 11:34:08 +02:00
|
|
|
print_separator("App Store");
|
2018-08-19 14:45:23 +03:00
|
|
|
|
2018-12-11 16:43:26 +02:00
|
|
|
let success = || -> Result<(), Error> {
|
2018-12-31 13:34:56 +02:00
|
|
|
run_type
|
|
|
|
|
.execute("softwareupdate")
|
2018-08-22 16:40:39 +03:00
|
|
|
.args(&["--install", "--all"])
|
|
|
|
|
.spawn()?
|
|
|
|
|
.wait()?
|
|
|
|
|
.check()?;
|
|
|
|
|
Ok(())
|
2018-12-11 16:00:19 +02:00
|
|
|
}()
|
|
|
|
|
.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
|
|
|
}
|