aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMax Howell2012-08-22 15:50:27 -0400
committerMax Howell2012-08-29 12:41:35 -0400
commitb1dc03861e37d110c3846653e0b2da1ffbab74c0 (patch)
tree5e9f0bdff1a0c391bc234abaf242a275f29efa6b /bin
parentf4f5994dc42023b1b0993fd24c9a1fe274f1c12d (diff)
downloadhomebrew-b1dc03861e37d110c3846653e0b2da1ffbab74c0.tar.bz2
Much better CTRL-C handling
Let's not show weird error messages when user interrupts during various stages of brew initialization. Tested by doing `for x in $(brew search); do brew install $x; done` and pressing CTRL-C at random short intervals.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/brew b/bin/brew
index 77b2f59bb..93fbbe9f2 100755
--- a/bin/brew
+++ b/bin/brew
@@ -1,6 +1,8 @@
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
# -*- coding: utf-8 -*-
+std_trap = trap("INT") { exit! 130 } # no backtrace thanks
+
HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] = File.expand_path(__FILE__)
require 'pathname'
@@ -49,6 +51,8 @@ rescue LoadError => e
end
begin
+ trap("INT", std_trap) # restore default CTRL-C handler
+
aliases = {'ls' => :list,
'homepage' => :home,
'-S' => :search,