diff options
| author | Jack Nagel | 2014-07-11 20:28:17 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-11 20:28:17 -0500 |
| commit | a2ef43b2a4fa1ec7925c70d3221f4d16dacdf243 (patch) | |
| tree | a8709176db23d1f246c9fbb52e71d53956ed6a1e /Library/Contributions | |
| parent | a7ca4bc3002d9977e988d5407f702b773e52a135 (diff) | |
| download | brew-a2ef43b2a4fa1ec7925c70d3221f4d16dacdf243.tar.bz2 | |
Only compute the log file path once per call
Diffstat (limited to 'Library/Contributions')
| -rwxr-xr-x | Library/Contributions/cmd/brew-test-bot.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Library/Contributions/cmd/brew-test-bot.rb b/Library/Contributions/cmd/brew-test-bot.rb index 27ccfe4ac..9cdaf666e 100755 --- a/Library/Contributions/cmd/brew-test-bot.rb +++ b/Library/Contributions/cmd/brew-test-bot.rb @@ -93,9 +93,11 @@ class Step start_time = Time.now + log = log_file_path + pid = fork do - STDOUT.reopen(log_file_path, "wb") - STDERR.reopen(log_file_path, "wb") + STDOUT.reopen(log, "wb") + STDERR.reopen(log, "wb") Dir.chdir(@repository) if @command.first == "git" exec(*@command) end @@ -107,12 +109,12 @@ class Step @status = success ? :passed : :failed puts_result - return unless File.exist?(log_file_path) - @output = IO.read(log_file_path) + return unless File.exist?(log) + @output = File.read(log) if has_output? and (not success or @puts_output_on_success) puts @output end - FileUtils.rm log_file_path unless ARGV.include? "--keep-logs" + FileUtils.rm(log) unless ARGV.include? "--keep-logs" end end |
