diff options
| author | Max Howell | 2012-08-22 15:50:27 -0400 |
|---|---|---|
| committer | Max Howell | 2012-08-29 12:41:35 -0400 |
| commit | 20ce16a3ffd6485177121422734be0b7bba5c591 (patch) | |
| tree | 9c384aef15c87bcbbb5901e03e59450585c7c894 /bin | |
| parent | fb8c7e0aafdd487533cce6853fe845346d97c87c (diff) | |
| download | brew-20ce16a3ffd6485177121422734be0b7bba5c591.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-x | bin/brew | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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, |
