brew-bundle: exit on command failure

Closes Homebrew/homebrew#25053.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Larry Shaffer 2013-12-07 23:36:44 -07:00 committed by Mike McQuaid
parent cc4776cc23
commit 08ff164edd

View File

@ -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