From d4f757718505b080ef3bd60fbf9ab7a751453e9a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 14 Apr 2012 17:17:16 +1000 Subject: [PATCH] Add ofail command to print error and exit. --- Library/Homebrew/utils.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 6e1db30052..77d9fe9ca6 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -53,6 +53,10 @@ def onoe error puts lines unless lines.empty? end +def ofail error + onoe error + exit 1 +end def pretty_duration s return "2 seconds" if s < 3 # avoids the plural problem ;)