Skip to content

Pass multiple app argument to brew reinstall#285

Merged
ondrejfuhrer merged 7 commits intobuo:masterfrom
Mick235711:multi-arg
Dec 3, 2025
Merged

Pass multiple app argument to brew reinstall#285
ondrejfuhrer merged 7 commits intobuo:masterfrom
Mick235711:multi-arg

Conversation

@Mick235711
Copy link
Contributor

This PR tries to change the way brew cu calls brew reinstall, so that only one command brew reinstall app1 app2 ... is issued instead of calling reinstall for each app. This has multiple advantages:

Interactive mode is also supported, as the apps are already collected anyway. MAS apps are passed as a single command to mas upgrade too.

The output is changed to "Update N apps", and the version for updated apps is printed if -v is passed. The version format mirrors the vanilla brew upgrade format.

Screenshot:
CleanShot 2025-11-30 at 19 11 47@2x

@ondrejfuhrer
Copy link
Collaborator

Hey @Mick235711
Thank you for your contribution. However for some reason it doesn't really work for me, I don't get any progress 🤔 any idea why is that?
CleanShot 2025-12-02 at 11 22 05@2x

It seemed "stuck", then it went to the mas apps but in the end, no casks were updated

@Mick235711
Copy link
Contributor Author

That's an interesting behavior. "Stuck" seems to be mas doing its thing, because the current logic first updates the MAS apps and only after mas upgrade finishes will the normal casks start updating... Does it work without --include-mas?

@ondrejfuhrer
Copy link
Collaborator

That's an interesting behavior. "Stuck" seems to be mas doing its thing, because the current logic first updates the MAS apps and only after mas upgrade finishes will the normal casks start updating... Does it work without --include-mas?

Yes, without MAS it seems to work 🤔 Should we preserve the same order that we have right now, Casks first and after MAS? And I'll check what's going on with my MAS 😅

@Mick235711
Copy link
Contributor Author

Sure, I can switch the order such that casks are upgraded first.

@ondrejfuhrer
Copy link
Collaborator

After I pulled the newest changes, getting this:

Error: undefined method 'downcase' for nil
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/upgrade.rb:264:in 'block in Bcu::Upgrade#mas_load_outdated'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/upgrade.rb:262:in 'Array#each'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/upgrade.rb:262:in 'Bcu::Upgrade#mas_load_outdated'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/upgrade.rb:95:in 'Bcu::Upgrade#include_mas_applications'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/upgrade.rb:34:in 'Bcu::Upgrade#run_process'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/upgrade.rb:10:in 'Bcu::Upgrade#process'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:24:in 'Bcu.process'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:75:in '<main>'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.7/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:37:in 'Kernel#require'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.7/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:37:in 'Kernel#require'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.7/lib/ruby/gems/3.4.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require'
/opt/homebrew/Library/Homebrew/utils.rb:17:in 'block in Homebrew.require?'
/opt/homebrew/Library/Homebrew/warnings.rb:29:in 'Warnings.ignore'
/opt/homebrew/Library/Homebrew/utils.rb:16:in 'Homebrew.require?'
/opt/homebrew/Library/Homebrew/brew.rb:116:in '<main>'
If reporting this issue please do so at (not Homebrew/* repositories):
  https://github.com/buo/homebrew-cask-upgrade/issues/new

Not sure if that's only me or others have the same issue as well.

@Mick235711
Copy link
Contributor Author

Hmm, not really sure what had happened, this PR does not touch the mas_load_outdated function...
What is the output from mas outdated? Perhaps the format was changed for some reason.

@ondrejfuhrer
Copy link
Collaborator

Hmm, not really sure what had happened, this PR does not touch the mas_load_outdated function... What is the output from mas outdated? Perhaps the format was changed for some reason.

I think I figured it out and pushed change to your branch (hope that's ok 🙂 ). I'll merge once the CI passes.

@Mick235711
Copy link
Contributor Author

Yeah, that's fine. Thanks a lot for the helping hand!

@ondrejfuhrer ondrejfuhrer merged commit dec00b8 into buo:master Dec 3, 2025
7 checks passed
@Mick235711 Mick235711 deleted the multi-arg branch December 3, 2025 09:04
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.

Avoid entering multiples root prompts when upgrading multiple casks [FR]Parallelization of downloads

3 participants