Skip to content

Commit

Permalink
Cache output
Browse files Browse the repository at this point in the history
  • Loading branch information
hakobera committed Jun 6, 2016
1 parent a79cebb commit 0bf0015
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tumugi/plugin/task/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CommandTask < Tumugi::Task

def output
unless output_file.nil?
Tumugi::Plugin::LocalFileTarget.new(output_file)
@output ||= Tumugi::Plugin::LocalFileTarget.new(output_file)
else
nil
end
Expand All @@ -35,8 +35,8 @@ def run

if status.exitstatus == 0
if output_file && _output
log "Save STDOUT into #{_output.path}"
_output.open('w') do |f|
log "Save STDOUT into #{output.path}"
output.open('w') do |f|
f.print(out)
end
end
Expand Down

0 comments on commit 0bf0015

Please sign in to comment.