aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-05-21 17:55:23 +0100
committerMax Howell2009-05-21 17:55:23 +0100
commited0f997d18802f833711888f2f5f2f57979e1aaf (patch)
treef9b179f1ddb4b9d785538f5d3afdd44807f808b1
parent8b4f826c3c8f93d780a5fc052d4934ba51b1fdaa (diff)
downloadbrew-ed0f997d18802f833711888f2f5f2f57979e1aaf.tar.bz2
Handle CTRL-C and RuntimeErrors prettily
But not the rest
-rw-r--r--Cellar/homebrew/brewkit.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/Cellar/homebrew/brewkit.rb b/Cellar/homebrew/brewkit.rb
index 96c653767..060145b71 100644
--- a/Cellar/homebrew/brewkit.rb
+++ b/Cellar/homebrew/brewkit.rb
@@ -165,9 +165,12 @@ end
# force a prettier exception handler unless --verbose or HOMEBREW_DEBUG
Kernel.at_exit {
- unless ARGV.include? '--verbose' or ENV['HOMEBREW_DEBUG']
- puts "\033[1;31mError\033[0;0m: #{$!}" if $!
- exit! 1
+ if $! and not (ARGV.include? '--verbose' or ENV['HOMEBREW_DEBUG'])
+ exit! 130 if $1.class == Interrupt #control-c
+ if $!.kind_of? StandardError
+ puts "\033[1;31mError\033[0;0m: #{$!}"
+ exit! 1
+ end
end
}