Write output from `sh' task action directly:

* Accept output as argument in Remote#execute;
* Modify ShellCommand so that env output is directly handled.
This commit is contained in:
Thibault Jouan
2014-03-05 06:06:42 +00:00
parent 400fa1ee3f
commit db3644a3e6
5 changed files with 22 additions and 8 deletions

View File

@@ -6,18 +6,20 @@ module Producer
raise 'no session for mock remote!'
end
def execute(command)
def execute(command, output = '')
tokens = command.split
program = tokens.shift
case program
when 'echo'
tokens.join ' '
output << tokens.join(' ')
when 'true'
''
output << ''
when 'false'
raise RemoteCommandExecutionError
end
output
end
end
end