From 07b9037eafa7da5f039374aef674d8b6f43f2b14 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 22 May 2009 14:49:58 +0100 Subject: [PATCH] Really handle CTRL-C --- Cellar/homebrew/brewkit.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cellar/homebrew/brewkit.rb b/Cellar/homebrew/brewkit.rb index 87ae0de878..93dd5c2fdb 100644 --- a/Cellar/homebrew/brewkit.rb +++ b/Cellar/homebrew/brewkit.rb @@ -182,8 +182,10 @@ end # force a prettier exception handler unless --verbose or HOMEBREW_DEBUG Kernel.at_exit { if $! and not (ARGV.include? '--verbose' or ENV['HOMEBREW_DEBUG']) - exit! 130 if $1.class == Interrupt #control-c - if $!.kind_of? StandardError + if $!.kind_of? Interrupt #control-c + puts # seeimgly a newline is more typical + exit! 130 + elsif $!.kind_of? StandardError puts "\033[1;31mError\033[0;0m: #{$!}" exit! 1 end