Add mas support for macOS (fix #307)

This commit is contained in:
Roey Darwish Dror
2020-01-28 16:22:17 +02:00
parent d2f038f6a6
commit b5e5cb0b32
3 changed files with 14 additions and 4 deletions

View File

@@ -585,9 +585,11 @@ fn run() -> Result<()> {
#[cfg(target_os = "macos")]
{
if config.should_run(Step::System) {
execute(&mut report, "App Store", || macos::run_mas(run_type), config.no_retry())?;
execute(
&mut report,
"App Store",
"System upgrade",
|| macos::upgrade_macos(run_type),
config.no_retry(),
)?;

View File

@@ -1,9 +1,17 @@
use crate::executor::RunType;
use crate::terminal::print_separator;
use crate::utils::require;
use anyhow::Result;
pub fn run_mas(run_type: RunType) -> Result<()> {
let mas = require("mas")?;
print_separator("macOS App Store");
run_type.execute(mas).arg("upgrade").check_run()
}
pub fn upgrade_macos(run_type: RunType) -> Result<()> {
print_separator("App Store");
print_separator("macOS system update");
run_type
.execute("softwareupdate")