diff options
| author | Max Howell | 2012-08-22 15:50:27 -0400 | 
|---|---|---|
| committer | Max Howell | 2012-08-29 12:41:35 -0400 | 
| commit | b1dc03861e37d110c3846653e0b2da1ffbab74c0 (patch) | |
| tree | 5e9f0bdff1a0c391bc234abaf242a275f29efa6b /bin | |
| parent | f4f5994dc42023b1b0993fd24c9a1fe274f1c12d (diff) | |
| download | homebrew-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-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, | 
