brew-bundle: exit on command failure
Closes Homebrew/homebrew#25053. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
cc4776cc23
commit
08ff164edd
@ -30,10 +30,11 @@ end
|
|||||||
|
|
||||||
raise "Cannot find Brewfile#{error}" unless File.exist? path
|
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
|
command = line.chomp
|
||||||
next if command.empty?
|
next if command.empty?
|
||||||
next if command.chars.first == '#'
|
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
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user