Sha256: 2f8fbd7b283933a5df972ff16e67cc78cc401da40405765f3be8f2673c1e7237

Contents?: true

Size: 750 Bytes

Versions: 1

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true
require "shopify_cli/theme/dev_server"

module Theme
  class Command
    class Serve < ShopifyCLI::SubCommand
      options do |parser, flags|
        parser.on("--bind=HOST") { |bind| flags[:bind] = bind.to_s }
        parser.on("--port=PORT") { |port| flags[:port] = port.to_i }
        parser.on("--poll") { flags[:poll] = true }
      end

      def call(*)
        flags = options.flags.dup
        ShopifyCLI::Theme::DevServer.start(@ctx, ".", **flags) do |syncer|
          UI::SyncProgressBar.new(syncer).progress(:upload_theme!, delay_low_priority_files: true)
        end
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shopify-cli-2.6.6 lib/project_types/theme/commands/serve.rb