diff --git a/README.md b/README.md index 564a79ab..c02a489c 100644 --- a/README.md +++ b/README.md @@ -130,13 +130,13 @@ Just run `topgrade`. It will run the following steps: * **Linux**: Update snap packages * **Linux**: Run [fwupdmgr](https://github.com/hughsie/fwupd) to show firmware upgrade. (View only. No upgrades will actually be performed) -* **Linux**: Run `rpi-update` to update Raspberry Pi Firmware * **Linux**: Run [pihole](https://pi-hole.net/) updater * Run custom defined commands * Final stage * **Linux**: Run [needrestart](https://github.com/liske/needrestart) * **Windows**: Run Windows Update (You'll have to install [PSWindowsUpdate](https://marckean.com/2016/06/01/use-powershell-to-install-windows-updates/)) - * **macOS**: Upgrade App Store applications + * **macOS**: Upgrade App Store applications using [mas](https://github.com/mas-cli/mas) + * **macOS**: Upgrade the system * **FreeBSD**: Run `freebsd-upgrade` ## Customization diff --git a/src/main.rs b/src/main.rs index 2c02a09a..39ca3d58 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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(), )?; diff --git a/src/steps/os/macos.rs b/src/steps/os/macos.rs index 691016b6..c301df9b 100644 --- a/src/steps/os/macos.rs +++ b/src/steps/os/macos.rs @@ -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")