Handle CTRL-C and RuntimeErrors prettily
But not the rest
This commit is contained in:
parent
8b4f826c3c
commit
ed0f997d18
@ -165,10 +165,13 @@ 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 $!
|
||||
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
|
||||
}
|
||||
|
||||
########################################################################script
|
||||
|
Loading…
x
Reference in New Issue
Block a user