Sha256: 6490ad52d274074e99491a04b1429bc5d0ef59381c431d522822c3fe0e7faead

Contents?: true

Size: 847 Bytes

Versions: 9

Compression:

Stored size: 847 Bytes

Contents

# frozen_string_literal: true
require "shopify_cli"

module Extension
  class Command
    class ExtensionCommand < ShopifyCli::SubCommand
      def project
        @project ||= ExtensionProject.current
      end

      def specification_handler
        @specification_handler ||= begin
          identifier = project.specification_identifier
          Models::LazySpecificationHandler.new(identifier) do
            specifications = Models::Specifications.new(
              fetch_specifications: Tasks::FetchSpecifications.new(api_key: project.app.api_key, context: @ctx)
            )

            unless specifications.valid?(identifier)
              @ctx.abort(@ctx.message("errors.unknown_type", project.specification_identifier))
            end

            specifications[identifier]
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shopify-cli-2.4.0 lib/project_types/extension/commands/extension_command.rb
shopify-cli-2.3.0 lib/project_types/extension/commands/extension_command.rb
shopify-cli-2.2.2 lib/project_types/extension/commands/extension_command.rb
shopify-cli-2.2.1 lib/project_types/extension/commands/extension_command.rb
shopify-cli-2.2.0 lib/project_types/extension/commands/extension_command.rb
shopify-cli-2.1.0 lib/project_types/extension/commands/extension_command.rb
shopify-cli-2.0.2 lib/project_types/extension/commands/extension_command.rb
shopify-cli-2.0.1 lib/project_types/extension/commands/extension_command.rb
shopify-cli-2.0.0 lib/project_types/extension/commands/extension_command.rb