Sha256: b5ed0f67dc978ad14b0ce874c82828f415394834f9310b173f10f1e07cb4ba1f

Contents?: true

Size: 1.27 KB

Versions: 10

Compression:

Stored size: 1.27 KB

Contents

module ShopifyCLI
  module Commands
    class App
      class Serve < ShopifyCLI::Command::AppSubCommand
        include ShopifyCLI::CommandOptions::CommandServeOptions

        prerequisite_task :ensure_env, :ensure_dev_store

        options do |parser, flags|
          parser.on("--host=HOST") do |h|
            flags[:host] = h.gsub('"', "")
          end
          parser.on("--port=PORT") { |port| flags[:port] = port }
        end

        def call(*)
          case detect_app
          when :rails
            Services::App::Serve::RailsService.call(
              host: host,
              port: port,
              context: @ctx
            )
          when :node
            Services::App::Serve::NodeService.call(
              host: host,
              port: port,
              context: @ctx
            )
          when :php
            Services::App::Serve::PHPService.call(
              host: host,
              port: port,
              context: @ctx
            )
          end
        end

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

        def self.extended_help
          ShopifyCLI::Context.message("app.core.serve.extended_help")
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shopify-cli-2.10.2 lib/shopify_cli/commands/app/serve.rb
shopify-cli-2.10.1 lib/shopify_cli/commands/app/serve.rb
shopify-cli-2.10.0 lib/shopify_cli/commands/app/serve.rb
shopify-cli-2.9.0 lib/shopify_cli/commands/app/serve.rb
shopify-cli-2.8.0 lib/shopify_cli/commands/app/serve.rb
shopify-cli-2.7.4 lib/shopify_cli/commands/app/serve.rb
shopify-cli-2.7.3 lib/shopify_cli/commands/app/serve.rb
shopify-cli-2.7.2 lib/shopify_cli/commands/app/serve.rb
shopify-cli-2.7.1 lib/shopify_cli/commands/app/serve.rb
shopify-cli-2.7.0 lib/shopify_cli/commands/app/serve.rb