Skip to content

Commit

Permalink
Merge pull request #29 from thinkerbot/exit_on_error
Browse files Browse the repository at this point in the history
Make conversion exit on cmd error
  • Loading branch information
nirvdrum committed Dec 27, 2011
2 parents fa6492b + f63db49 commit 3582caf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/svn2git/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,19 @@ def run_command(cmd)

ret = ''

cmd = "2>&1 #{cmd}"
IO.popen(cmd) do |stdout|
stdout.each do |line|
log line
ret << line
end
end

unless $?.exitstatus == 0
$stderr.puts "command failed:\n#{cmd}"
exit 1
end

ret
end

Expand Down

0 comments on commit 3582caf

Please sign in to comment.