diff options
| author | Mike McQuaid | 2013-02-17 13:30:58 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2013-02-18 10:42:43 +0000 |
| commit | 8c02467002d4575fbf34dd90e170d220185cb1c9 (patch) | |
| tree | 2000db5fed3742886e5856f5c12ef591a83a1239 /bin | |
| parent | 9f2782812cbaf2ab8edc0da5a5719b3633f1e4c7 (diff) | |
| download | homebrew-8c02467002d4575fbf34dd90e170d220185cb1c9.tar.bz2 | |
Rework brew command dispatch order.
Make it no longer possible to override e.g. `brew install` with a
script if there is already a built-in Homebrew command named
`brew install`.
References #17673
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/brew | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -83,15 +83,15 @@ begin # Add example external commands to PATH before checking. ENV['PATH'] += ":#{HOMEBREW_REPOSITORY}/Library/Contributions/cmds" - if which "brew-#{cmd}" + if require? HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"/cmd + Homebrew.send cmd.to_s.gsub('-', '_').downcase + elsif which "brew-#{cmd}" %w[CACHE CELLAR LIBRARY_PATH PREFIX REPOSITORY].each do |e| ENV["HOMEBREW_#{e}"] = Object.const_get "HOMEBREW_#{e}" end exec "brew-#{cmd}", *ARGV elsif require? `/usr/bin/which brew-#{cmd}.rb` exit 0 - elsif require? HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"/cmd - Homebrew.send cmd.to_s.gsub('-', '_').downcase else onoe "Unknown command: #{cmd}" exit 1 |
