Make sure redirected stdout and stderr share the same offset

This fixes broken output like this:

  Error: No such file or directory - non_existent_file
  ee/src/tree-1.7.0.tgz
  Already downloaded: /Library/Caches/Homebrew/tree-1.7.0.tgz
  ==> Verifying tree-1.7.0.tgz checksum
  tar xf /Library/Caches/Homebrew/tree-1.7.0.tgz
This commit is contained in:
Jack Nagel 2014-09-07 20:12:05 -05:00
parent 758608815f
commit 6b423c8cfb

View File

@ -105,8 +105,10 @@ class Step
log = log_file_path
pid = fork do
STDOUT.reopen(log, "wb")
STDERR.reopen(log, "wb")
File.open(log, "wb") do |f|
STDOUT.reopen(f)
STDERR.reopen(f)
end
Dir.chdir(@repository) if @command.first == "git"
exec(*@command)
end