Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use sudo softwareupdate --install --all --restart to update macOS #627

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/steps/os/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@ pub fn upgrade_macos(ctx: &ExecutionContext) -> Result<()> {
}
}

let mut command = ctx.run_type().execute("softwareupdate");
command.args(["--install", "--all"]);
// We don't know what the proper command to use here cause the macOS man
// page is poor.
//
// man: https://keith.github.io/xcode-man-pages/softwareupdate.8.html
// issue: https://github.com/topgrade-rs/topgrade/issues/546
let sudo = require_option(ctx.sudo().as_ref(), REQUIRE_SUDO.to_string())?;
let mut command = ctx.run_type().execute(sudo);
command.args(["softwareupdate", "--install", "--all", "--restart"]);

if should_ask {
command.arg("--no-scan");
Expand Down