Sha256: ae530ebdf00e026d0295a9bcf267f347d869978fc659d216afa415ffdc0e809b
Contents?: true
Size: 1.34 KB
Versions: 15
Compression:
Stored size: 1.34 KB
Contents
# frozen_string_literal: true require "shopify_cli" require "yaml" module Extension module Tasks class MergeServerConfig include SmartProperties property! :context, accepts: ShopifyCLI::Context property! :file_path, accepts: ->(path) { Pathname(path).yield_self { |pn| pn.absolute? && pn.file? } } property :port, accepts: Integer, default: ShopifyCLI::Constants::Extension::DEFAULT_PORT property :resource_url, accepts: String property :tunnel_url, accepts: String property! :type, accepts: Models::DevelopmentServerRequirements::SUPPORTED_EXTENSION_TYPES def self.call(*args) new(*args).call end def call config = YAML.load_file(file_path) project = ExtensionProject.current Tasks::ConvertServerConfig.call( api_key: project.env.api_key, context: context, hash: config, registration_uuid: project.registration_uuid, resource_url: resource_url || project.resource_url, store: project.env.shop || "", title: project.title, tunnel_url: tunnel_url, type: type ) rescue Psych::SyntaxError => e raise( ShopifyCLI::Abort, ShopifyCLI::Context.message("core.yaml.error.invalid", file_name, e.message) ) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems