Add mas support for macOS (fix #307)
This commit is contained in:
@@ -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(),
|
||||
)?;
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user