Sha256: 19582d20272efb465665c23c12172ad41ee093947f0677e973e6cd1a80d35942

Contents?: true

Size: 1003 Bytes

Versions: 11

Compression:

Stored size: 1003 Bytes

Contents

# frozen_string_literal: true

require "shopify_cli"

module Node
  module Commands
    class Tunnel < ShopifyCli::Command
      # subcommands :auth, :start, :stop

      def call(args, _name)
        subcommand = args.shift
        case subcommand
        when "auth"
          token = args.shift
          if token.nil?
            @ctx.puts(@ctx.message("node.tunnel.error.token_argument_missing"))
            @ctx.puts("#{self.class.help}\n#{self.class.extended_help}")
          else
            ShopifyCli::Tunnel.auth(@ctx, token)
          end
        when "start"
          ShopifyCli::Tunnel.start(@ctx)
        when "stop"
          ShopifyCli::Tunnel.stop(@ctx)
        else
          @ctx.puts(self.class.help)
        end
      end

      def self.help
        ShopifyCli::Context.message("node.tunnel.help", ShopifyCli::TOOL_NAME)
      end

      def self.extended_help
        ShopifyCli::Context.message("node.tunnel.extended_help", ShopifyCli::TOOL_NAME)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shopify-cli-1.14.0 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.13.1 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.13.0 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.12.0 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.11.0 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.10.0 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.9.1 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.9.0 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.8.0 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.7.1 lib/project_types/node/commands/tunnel.rb
shopify-cli-1.7.0 lib/project_types/node/commands/tunnel.rb