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 accounts
mas 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 install first (fast path for already-associated apps)
- Fall back to
mas get if 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
Problem
brew bundleusesmas installfor Mac App Store entries in the Brewfile. However,mas installonly works for apps previously associated with the Apple Account — it fails with: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 appsFrom
mas help:Proposed change
Change
mac_app_store_installer.rbto usemas getinstead ofmas installfor initial installs. This would make Brewfiles work on fresh machines/accounts without requiring users to manually pre-install each app.A possible approach:
mas installfirst (fast path for already-associated apps)mas getif install fails with the redownload errorOr simply always use
mas getwhich 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 beforebrew 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