Make brew --prefix very fast

Because people use this in .bash_profile etc. We should be as fast as possible.
This commit is contained in:
Max Howell 2012-08-28 09:52:13 -04:00
parent 0efd1b9efe
commit 0ac3e83a7a

View File

@ -5,6 +5,11 @@ std_trap = trap("INT") { exit! 130 } # no backtrace thanks
HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] = File.expand_path(__FILE__) HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] = File.expand_path(__FILE__)
if ARGV == %w{--prefix}
puts File.dirname(File.dirname(HOMEBREW_BREW_FILE))
exit 0
end
require 'pathname' require 'pathname'
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.dirname.parent.join("Library/Homebrew").to_s HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.dirname.parent.join("Library/Homebrew").to_s
$:.unshift(HOMEBREW_LIBRARY_PATH + '/vendor') $:.unshift(HOMEBREW_LIBRARY_PATH + '/vendor')