aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/brew.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/brew.rb')
-rw-r--r--Library/Homebrew/brew.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb
index e21e0bbd4..bb663537d 100644
--- a/Library/Homebrew/brew.rb
+++ b/Library/Homebrew/brew.rb
@@ -33,7 +33,6 @@ begin
empty_argv = ARGV.empty?
help_flag_list = %w[-h --help --usage -?]
help_flag = !ENV["HOMEBREW_HELP"].nil?
- internal_cmd = true
cmd = nil
ARGV.dup.each_with_index do |arg, i|
@@ -60,8 +59,9 @@ begin
internal_cmd = require? HOMEBREW_LIBRARY_PATH/"cmd"/cmd
unless internal_cmd
- internal_cmd = require? HOMEBREW_LIBRARY_PATH/"dev-cmd"/cmd
- if internal_cmd && !ARGV.homebrew_developer?
+ internal_dev_cmd = require? HOMEBREW_LIBRARY_PATH/"dev-cmd"/cmd
+ internal_cmd = internal_dev_cmd
+ if internal_dev_cmd && !ARGV.homebrew_developer?
system "git", "config", "--file=#{HOMEBREW_REPOSITORY}/.git/config",
"--replace-all", "homebrew.devcmdrun", "true"
ENV["HOMEBREW_DEV_CMD_RUN"] = "1"
@@ -90,8 +90,7 @@ begin
unless internal_cmd
# Add contributed commands to PATH before checking.
- tap_cmds = Pathname.glob(Tap::TAP_DIRECTORY/"*/*/cmd")
- homebrew_path.append(tap_cmds)
+ homebrew_path.append(Tap.cmd_directories)
# External commands expect a normal PATH
ENV["PATH"] = homebrew_path
@@ -100,14 +99,13 @@ begin
if internal_cmd
Homebrew.send cmd.to_s.tr("-", "_").downcase
elsif which "brew-#{cmd}"
- %w[CACHE LIBRARY_PATH].each do |e|
- ENV["HOMEBREW_#{e}"] = Object.const_get("HOMEBREW_#{e}").to_s
+ %w[CACHE LIBRARY_PATH].each do |env|
+ ENV["HOMEBREW_#{env}"] = Object.const_get("HOMEBREW_#{env}").to_s
end
exec "brew-#{cmd}", *ARGV
elsif (path = which("brew-#{cmd}.rb")) && require?(path)
exit Homebrew.failed? ? 1 : 0
else
- require "tap"
possible_tap = OFFICIAL_CMD_TAPS.find { |_, cmds| cmds.include?(cmd) }
possible_tap = Tap.fetch(possible_tap.first) if possible_tap