aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-01-27 10:29:58 +0000
committerMike McQuaid2016-01-27 12:49:25 +0000
commit7260b35c311cc78371f1e984ce78302b0a565d91 (patch)
tree495cfb82f041f4ae8a4600760ccee9fa800b71fb /Library
parente07b5a98e07121dbca02b2bba42b32caad7d7ff7 (diff)
downloadbrew-7260b35c311cc78371f1e984ce78302b0a565d91.tar.bz2
config: fail when HOMEBREW_BREW_FILE is unset.
Not sure why this is happening (beyond the Chef cookbook stupidly deciding to not call through `bin/brew`) but fail and print a scary looking error to hope to point people in the right direction. Closes Homebrew/homebrew#48261. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/config.rb5
-rwxr-xr-xLibrary/brew.rb2
2 files changed, 3 insertions, 4 deletions
diff --git a/Library/Homebrew/config.rb b/Library/Homebrew/config.rb
index 692a43988..85c471328 100644
--- a/Library/Homebrew/config.rb
+++ b/Library/Homebrew/config.rb
@@ -26,8 +26,9 @@ undef cache
# Where brews installed via URL are cached
HOMEBREW_CACHE_FORMULA = HOMEBREW_CACHE+"Formula"
-unless defined? HOMEBREW_BREW_FILE
- HOMEBREW_BREW_FILE = ENV["HOMEBREW_BREW_FILE"] || which("brew").to_s
+HOMEBREW_BREW_FILE = ENV["HOMEBREW_BREW_FILE"]
+unless HOMEBREW_BREW_FILE
+ odie "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
end
# Where we link under
diff --git a/Library/brew.rb b/Library/brew.rb
index 36dd901a5..754102c2a 100755
--- a/Library/brew.rb
+++ b/Library/brew.rb
@@ -2,8 +2,6 @@
std_trap = trap("INT") { exit! 130 } # no backtrace thanks
-HOMEBREW_BREW_FILE = ENV["HOMEBREW_BREW_FILE"]
-
require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent.join("Homebrew")
$:.unshift(HOMEBREW_LIBRARY_PATH.to_s)