Skip to content

Commit 6c00931

Browse files
feat: use sudo and --restart for macOS softwareupdate (topgrade-rs#627)
Run `softwareupdate` through sudo and add the `--restart` flag so that the system can reboot automatically when a macOS update requires it. This aligns with the behavior described in the softwareupdate(8) man page. Based-on-PR: topgrade-rs#627 Original-author: Steve Lau <stevelauc@outlook.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4cd5df8 commit 6c00931

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/steps/os/macos.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ pub fn upgrade_macos(ctx: &ExecutionContext) -> Result<()> {
5252
}
5353
}
5454

55-
let mut command = ctx.execute("softwareupdate");
56-
command.args(["--install", "--all"]);
55+
let sudo = ctx.require_sudo()?;
56+
let mut command = sudo.execute(ctx, "softwareupdate")?;
57+
command.args(["--install", "--all", "--restart"]);
5758

5859
if should_ask {
5960
command.arg("--no-scan");

0 commit comments

Comments
 (0)