17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/pytty/client/cli/run_command.rb', line 17
def execute
Async.run do |task|
response, body = Pytty::Client::Api::Yield.run id: name, cmd: cmd_list, env: {}
unless response.status == 200
puts body
exit 1
end
process_yield = Pytty::Client::ProcessYield.from_json body
unless detach?
task.async do
process_yield.attach interactive: interactive?
end
end
process_yield.spawn tty: tty?, interactive: interactive?
if detach?
puts process_yield.id
end
end
end
|