Sha256: 11166f82fc15647b531403a994cf41f188614b3627a592177e3c123da1549915

Contents?: true

Size: 672 Bytes

Versions: 2

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true
require 'async'
require 'async/http'
require 'async/http/internet'
require 'json'

module Pytty
  module Client
    module Cli
      class YieldCommand < Clamp::Command
        parameter "CMD ...", "command"
        option ["--name"], "NAME", "name"

        def execute
          response, json = Async.run do
            Pytty::Client::Api::Yield.run cmd: cmd_list, id: name, env: {}
          end.wait

          if response.status == 200
            process_yield = ::Pytty::Client::ProcessYield.from_json json
            puts process_yield.id
          else
            puts json
          end

        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pytty-0.5.0 lib/pytty/client/cli/yield_command.rb
pytty-0.4.1 lib/pytty/client/cli/yield_command.rb