Class: Pytty::Client::Cli::RunCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/pytty/client/cli/run_command.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/pytty/client/cli/run_command.rb', line 16

def execute
  Async.run do
    json = Pytty::Client::Api::Yield.run cmd: cmd_list, env: {}
    process_yield = Pytty::Client::ProcessYield.from_json json
    process_yield.spawn tty: tty?, interactive: interactive?

    if detach?
      puts process_yield.id
    else
      process_yield.attach
    end
  end
end