Sha256: 1bec4428c9896f00b8c7ab019c22b53e27f8137ea5d5bcb27a5a2e98b875cbff

Contents?: true

Size: 954 Bytes

Versions: 11

Compression:

Stored size: 954 Bytes

Contents

require "shopify_cli"

module ShopifyCli
  module Commands
    Registry = CLI::Kit::CommandRegistry.new(
      default: "help",
      contextual_resolver: nil,
    )
    @core_commands = []

    def self.register(const, cmd, path = nil, is_core = false)
      autoload(const, path) if path
      Registry.add(->() { const_get(const) }, cmd)
      @core_commands.push(cmd) if is_core
    end

    def self.core_command?(cmd)
      @core_commands.include?(cmd)
    end

    register :Config, "config", "shopify-cli/commands/config", true
    register :Connect, "connect", "shopify-cli/commands/connect", true
    register :Create, "create", "shopify-cli/commands/create", true
    register :Help, "help", "shopify-cli/commands/help", true
    register :Logout, "logout", "shopify-cli/commands/logout", true
    register :System, "system", "shopify-cli/commands/system", true
    register :Version, "version", "shopify-cli/commands/version", true
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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