Sha256: 8f94fa8fb964313e40d57671a536fa097ce4f8f195513515cff0cdcb6598fac0

Contents?: true

Size: 958 Bytes

Versions: 8

Compression:

Stored size: 958 Bytes

Contents

# frozen_string_literal: true

require "shopify_cli"

module PHP
  class Command
    class Tunnel < ShopifyCLI::SubCommand
      def call(args, _name)
        subcommand = args.shift
        case subcommand
        when "auth"
          token = args.shift
          if token.nil?
            @ctx.puts(@ctx.message("php.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("php.tunnel.help", ShopifyCLI::TOOL_NAME)
      end

      def self.extended_help
        ShopifyCLI::Context.message("php.tunnel.extended_help", ShopifyCLI::TOOL_NAME)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shopify-cli-2.6.6 lib/project_types/php/commands/tunnel.rb
shopify-cli-2.6.5 lib/project_types/php/commands/tunnel.rb
shopify-cli-2.6.4 lib/project_types/php/commands/tunnel.rb
shopify-cli-2.6.3 lib/project_types/php/commands/tunnel.rb
shopify-cli-2.6.2 lib/project_types/php/commands/tunnel.rb
shopify-cli-2.6.1 lib/project_types/php/commands/tunnel.rb
shopify-cli-2.6.0 lib/project_types/php/commands/tunnel.rb
shopify-cli-2.5.0 lib/project_types/php/commands/tunnel.rb