diff options
| author | Mike McQuaid | 2017-06-03 10:00:07 +0100 |
|---|---|---|
| committer | GitHub | 2017-06-03 10:00:07 +0100 |
| commit | ff51f6ea426eb7852ed1e04fbbcfd632c518ea72 (patch) | |
| tree | 825283e0964a71e4419c359bde0d7f3675b9e9f0 /Library/Homebrew/brew.rb | |
| parent | b7d007fb50678a894a8424d7523acc3b2a7574d0 (diff) | |
| parent | 12e0a5ee7dc730c163655def44ae9e6dc316a44a (diff) | |
| download | brew-ff51f6ea426eb7852ed1e04fbbcfd632c518ea72.tar.bz2 | |
Merge pull request #2719 from MikeMcQuaid/external-command-homebrew-path
brew.rb: use HOMEBREW_PATH for external commands.
Diffstat (limited to 'Library/Homebrew/brew.rb')
| -rw-r--r-- | Library/Homebrew/brew.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index de42f5618..7222f7e87 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -49,12 +49,16 @@ begin end path = PATH.new(ENV["PATH"]) + homebrew_path = PATH.new(ENV["HOMEBREW_PATH"]) # Add contributed commands to PATH before checking. - path.append(Pathname.glob(Tap::TAP_DIRECTORY/"*/*/cmd")) + tap_cmds = Pathname.glob(Tap::TAP_DIRECTORY/"*/*/cmd") + path.append(tap_cmds) + homebrew_path.append(tap_cmds) # Add SCM wrappers. path.append(HOMEBREW_SHIMS_PATH/"scm") + homebrew_path.append(HOMEBREW_SHIMS_PATH/"scm") ENV["PATH"] = path @@ -89,6 +93,9 @@ begin system(HOMEBREW_BREW_FILE, "uninstall", "--force", "brew-cask") end + # External commands expect a normal PATH + ENV["PATH"] = homebrew_path unless internal_cmd + if internal_cmd Homebrew.send cmd.to_s.tr("-", "_").downcase elsif which "brew-#{cmd}" |
