Skip to content

bundle: allow preinstalled mas#21619

Merged
bevanjkay merged 1 commit intomainfrom
global-mas
Feb 24, 2026
Merged

bundle: allow preinstalled mas#21619
bevanjkay merged 1 commit intomainfrom
global-mas

Conversation

@bevanjkay
Copy link
Member

@bevanjkay bevanjkay commented Feb 24, 2026

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

I used codex to help discover the correct fix.


This PR aligns the handling of mas with other external dependencies for brew bundle, allowing the use of an externally installed binary, such as mas installed via upstream's package installer. The only downside I can see is that it is possible that the provided package could be use an interface that is incompatible if it is running an old version, but I'm not sure it is worth the extra effort to include version detection here, and this issue is not unique to mas.

Copilot AI review requested due to automatic review settings February 24, 2026 11:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables brew bundle to use a preinstalled mas binary from the system PATH, rather than requiring mas to be installed via Homebrew formula. This aligns the handling of mas with other external dependencies like cargo, go, flatpak, and vscode.

Changes:

  • Added which_mas method that uses which("mas", ORIGINAL_PATHS) to locate the mas binary
  • Updated mas_installed? to check for the presence of a mas binary via which_mas instead of checking for the formula
  • Modified mac_app_store_installer.rb to use Bundle.which_mas when checking for outdated apps
  • Modified mac_app_store_dumper.rb to use Bundle.which_mas when listing installed apps

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
Library/Homebrew/bundle.rb Added which_mas method and updated mas_installed? to use it, following the pattern of other external tools
Library/Homebrew/bundle/mac_app_store_installer.rb Updated outdated_app_ids method to use Bundle.which_mas instead of hardcoded "mas" command
Library/Homebrew/bundle/mac_app_store_dumper.rb Updated apps method to use Bundle.which_mas instead of hardcoded "mas" command

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bevanjkay bevanjkay force-pushed the global-mas branch 2 times, most recently from e311bc1 to be8e6ff Compare February 24, 2026 11:56
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @bevanjkay!

@bevanjkay
Copy link
Member Author

Just fixing a couple of things, so not ready for merge just yet

@MikeMcQuaid
Copy link
Member

@bevanjkay cool, just self-merge when you're happy!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bevanjkay bevanjkay added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 49a172a Feb 24, 2026
37 checks passed
@bevanjkay bevanjkay deleted the global-mas branch February 24, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants