Forward standard error stream from remote execution

This commit is contained in:
Thibault Jouan
2014-07-21 12:45:57 +00:00
parent a033e19583
commit db91eb06cd
14 changed files with 93 additions and 17 deletions

View File

@@ -6,13 +6,18 @@ module Producer
fail 'no session for mock remote!'
end
def execute(command, output = '')
tokens = command.split
def execute(command, output = '', error_output = '')
tokens = command.gsub(/\d?>.*/, '').split
program = tokens.shift
case program
when 'echo'
output << tokens.join(' ') << "\n"
out = tokens.join(' ') << "\n"
if command =~ />&2\z/
error_output << out
else
output << out
end
when 'true'
output << ''
when 'false'