Sha256: 47cd3968c5b8ef4b1133f22c29d9e8104fc5a6bd2c6e03c1045d8fe3f69ed692

Contents?: true

Size: 732 Bytes

Versions: 1

Compression:

Stored size: 732 Bytes

Contents

# frozen_string_literal: true
require "shopify_cli"
require "yaml"

module Extension
  module Tasks
    class LoadServerConfig < ShopifyCLI::Task
      include SmartProperties

      class << self
        def call(file_name:, type:)
          config = YAML.load_file(file_name)
          project = ExtensionProject.current
          Tasks::Converters::ServerConfigConverter.from_hash(
            hash: config,
            type: type,
            registration_uuid: project.registration_uuid
          )
        rescue Psych::SyntaxError => e
          raise(
            ShopifyCLI::Abort,
            ShopifyCLI::Context.message("core.yaml.error.invalid", file_name, e.message)
          )
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shopify-cli-2.6.6 lib/project_types/extension/tasks/load_server_config.rb