Permalink
Browse files

Merge pull request #29 from thinkerbot/exit_on_error

Make conversion exit on cmd error
  • Loading branch information...
nirvdrum committed Dec 27, 2011
2 parents fa6492b + f63db49 commit 3582caf3cb0f429b6c752aed0dbd6440df16c196
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/svn2git/migration.rb
View
@@ -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

0 comments on commit 3582caf

Please sign in to comment.