lib/chake/backend.rb in chake-0.19 vs lib/chake/backend.rb in chake-0.20
- old
+ new
@@ -21,14 +21,16 @@
node.path + '/'
end
def run(cmd)
printf "%#{Node.max_node_name_length}s: $ %s\n", node.hostname, cmd
- output = IO.popen(command_runner + [cmd], err: [:child, :out])
- output.each_line do |line|
+ io = IO.popen(command_runner + ['/bin/sh'], mode='w+', eer: [:child, :out])
+ io.write(cmd)
+ io.close_write
+ io.each_line do |line|
printf "%#{Node.max_node_name_length}s: %s\n", node.hostname, line.strip
end
- output.close
+ io.close
if $?
status = $?.exitstatus
if status != 0
raise CommandFailed.new([node.hostname, 'FAILED with exit status %d' % status].join(': '))
end