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.rb19
1 files changed, 5 insertions, 14 deletions
diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb
index 7222f7e87..11ea8df67 100644
--- a/Library/Homebrew/brew.rb
+++ b/Library/Homebrew/brew.rb
@@ -10,7 +10,8 @@ raise "Homebrew must be run under Ruby 2!" unless RUBY_TWO
require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent
-$:.unshift(HOMEBREW_LIBRARY_PATH.to_s)
+require "English"
+$LOAD_PATH.unshift(HOMEBREW_LIBRARY_PATH.to_s)
require "global"
require "tap"
@@ -20,14 +21,6 @@ if ARGV == %w[--version] || ARGV == %w[-v]
exit 0
end
-def require?(path)
- return false if path.nil?
- require path
-rescue LoadError => e
- # we should raise on syntax errors but not if the file doesn't exist.
- raise unless e.message.include?(path)
-end
-
begin
trap("INT", std_trap) # restore default CTRL-C handler
@@ -134,17 +127,15 @@ rescue Interrupt
$stderr.puts # seemingly a newline is typical
exit 130
rescue BuildError => e
- Utils::Analytics.report_exception(e)
+ Utils::Analytics.report_build_error(e)
e.dump
exit 1
rescue RuntimeError, SystemCallError => e
- Utils::Analytics.report_exception(e)
raise if e.message.empty?
onoe e
$stderr.puts e.backtrace if ARGV.debug?
exit 1
rescue MethodDeprecatedError => e
- Utils::Analytics.report_exception(e)
onoe e
if e.issues_url
$stderr.puts "If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):"
@@ -152,9 +143,9 @@ rescue MethodDeprecatedError => e
end
exit 1
rescue Exception => e
- Utils::Analytics.report_exception(e)
onoe e
- if internal_cmd && defined?(OS::ISSUES_URL)
+ if internal_cmd && defined?(OS::ISSUES_URL) &&
+ !ENV["HOMEBREW_NO_AUTO_UPDATE"]
$stderr.puts "#{Tty.bold}Please report this bug:#{Tty.reset}"
$stderr.puts " #{Formatter.url(OS::ISSUES_URL)}"
end