-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Description
Problem
brew bundle uses mas install for Mac App Store entries in the Brewfile. However, mas install only works for apps previously associated with the Apple Account — it fails with:
Error: Redownload Unavailable with this Apple Account
This affects even universally free apps like Keynote, Numbers, and Pages on fresh Apple Accounts that have never downloaded them.
Current mas CLI behavior
mas get(alias:mas purchase) — acquires and installs apps, works on fresh accountsmas install— only re-downloads previously acquired apps
From mas help:
get, purchase Get & install free apps from the App Store
install Install previously gotten apps from the App Store
Proposed change
Change mac_app_store_installer.rb to use mas get instead of mas install for initial installs. This would make Brewfiles work on fresh machines/accounts without requiring users to manually pre-install each app.
A possible approach:
- Try
mas installfirst (fast path for already-associated apps) - Fall back to
mas getif install fails with the redownload error
Or simply always use mas get which handles both cases.
Use case
Using a Brewfile to set up a new Mac for someone. All masApps fail because they were never previously downloaded on that Apple Account. The workaround is to manually run mas get <id> for each app before brew bundle, which defeats the purpose of automated setup.
Relevant code
https://github.com/Homebrew/brew/blob/master/Library/Homebrew/bundle/mac_app_store_installer.rb