Optimise more command handling/speed #17188
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
brew.sh
split thecase
into those cases that take a single or no arguments and those that take multiple arguments or handle multiple commands. This considerably speeds up thebrew shellenv bash
case that wasn't being handled here before.setup-ruby
to the list of commands that can be called quickly bybrew.sh
without additional setup. This speeds up thebrew setup-ruby
no-op case by ~10x.setup-ruby
to avoid running Bundler if the command doesn't need it. This makes many more cases forbrew setup-ruby
to be no-op cases.HOMEBREW_RUBY3
check insetup-ruby
.command_path.sh
to allow it to be used as a function insetup-ruby.sh
.install_bundler_gems!
is only insidedev-cmd
(or a few other acceptable places) (follow-up from CallHomebrew.install_bundler_gems!
more consistently. #17185 (comment))processed_source.file_path
API informula_cop.rb