Method: Foreplay::Engine::Remote::Step#execute_command

Defined in:
lib/foreplay/engine/remote/step.rb

#execute_command(command) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/foreplay/engine/remote/step.rb', line 21

def execute_command(command)
  o = ''
  process = shell.execute command
  process.on_output { |_, po| o += po }
  shell.wait!
  terminate(o) unless step['ignore_error'] == true || process.exit_status == 0
  o
end