aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/global.rb
diff options
context:
space:
mode:
authorMax Howell2009-11-07 18:09:48 +0000
committerMax Howell2009-11-08 15:21:14 +0000
commit86516e563fd7cd2d3777010d54cb4991acad844f (patch)
treef15b78364b5b11867f2650671eabd98540d16a81 /Library/Homebrew/global.rb
parent6b18d5572dd93d9bdde1786d6f7c457d01421dc7 (diff)
downloadbrew-86516e563fd7cd2d3777010d54cb4991acad844f.tar.bz2
Set ENV[HOMEBREW_BREW_FILE]
Thus install.rb gets the path to the instantiating brew process rather than whichever is first in the PATH. Not to mention Homebrew doesn't *have* to be in the PATH.
Diffstat (limited to 'Library/Homebrew/global.rb')
-rw-r--r--Library/Homebrew/global.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 52f3dd6a8..05fc144e2 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -38,6 +38,10 @@ else
HOMEBREW_CACHE=Pathname.new("~/Library/Caches/Homebrew").expand_path
end
+if not defined? HOMEBREW_BREW_FILE
+ HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] or `which brew`.chomp
+end
+
HOMEBREW_PREFIX = Pathname.new(HOMEBREW_BREW_FILE).dirname.parent # Where we link under
HOMEBREW_REPOSITORY = Pathname.new(HOMEBREW_BREW_FILE).realpath.dirname.parent # Where .git is found