Sha256: e6f88ba6fa5d8d0a6248137f16cc853d6e89fd269f416bb7c3d1f3f44828b33e

Contents?: true

Size: 848 Bytes

Versions: 11

Compression:

Stored size: 848 Bytes

Contents

# frozen_string_literal: true
module Theme
  module Commands
    class Serve < ShopifyCli::Command
      prerequisite_task :ensure_themekit_installed

      options do |parser, flags|
        parser.on("--env=ENV") { |env| flags[:env] = env }
        parser.on("--allow-live") { flags["allow-live"] = true }
        parser.on("--notify=FILES") { |files| flags["notify"] = files }
      end

      def call(*)
        if options.flags[:env]
          env = options.flags[:env]
          options.flags.delete(:env)
        end

        flags = Themekit.add_flags(options.flags)

        CLI::UI::Frame.open(@ctx.message("theme.serve.serve")) do
          Themekit.serve(@ctx, flags: flags, env: env)
        end
      end

      def self.help
        ShopifyCli::Context.message("theme.serve.help", ShopifyCli::TOOL_NAME)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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