brew-test-bot: fix output handling.
This commit is contained in:
parent
a70c44993f
commit
c479c680b8
@ -61,20 +61,20 @@ class Step
|
|||||||
step.puts_command
|
step.puts_command
|
||||||
|
|
||||||
command = "#{step.command} &>#{step.log_file_path}"
|
command = "#{step.command} &>#{step.log_file_path}"
|
||||||
|
|
||||||
output = nil
|
|
||||||
if command.start_with? 'git '
|
if command.start_with? 'git '
|
||||||
Dir.chdir step.repository do
|
Dir.chdir step.repository do
|
||||||
output = `#{command}`
|
`#{command}`
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
output = `#{command}`
|
`#{command}`
|
||||||
end
|
end
|
||||||
output = IO.read(step.log_file_path) rescue nil
|
|
||||||
|
|
||||||
success = $?.success?
|
success = $?.success?
|
||||||
step.status = success ? :passed : :failed
|
step.status = success ? :passed : :failed
|
||||||
step.puts_result
|
step.puts_result
|
||||||
|
|
||||||
|
return unless File.exists?(step.log_file_path)
|
||||||
|
output = IO.read(step.log_file_path)
|
||||||
if output and output.any? and (not success or puts_output_on_success)
|
if output and output.any? and (not success or puts_output_on_success)
|
||||||
puts output
|
puts output
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user