From 08ff164edd5fa33f8cfa93a83dbc5bdad9975275 Mon Sep 17 00:00:00 2001 From: Larry Shaffer Date: Sat, 7 Dec 2013 23:36:44 -0700 Subject: [PATCH] brew-bundle: exit on command failure Closes Homebrew/homebrew#25053. Signed-off-by: Mike McQuaid --- Library/Contributions/cmd/brew-bundle.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Contributions/cmd/brew-bundle.rb b/Library/Contributions/cmd/brew-bundle.rb index f0ce85d38a..0a9ce1ebc9 100755 --- a/Library/Contributions/cmd/brew-bundle.rb +++ b/Library/Contributions/cmd/brew-bundle.rb @@ -30,10 +30,11 @@ end raise "Cannot find Brewfile#{error}" unless File.exist? path -File.readlines(path).each do |line| +File.readlines(path).each_with_index do |line, index| command = line.chomp next if command.empty? next if command.chars.first == '#' - system "brew #{command}" + brew_cmd = "brew #{command}" + odie "Command failed: L#{index+1}:#{brew_cmd}" unless system brew_cmd end