Sha256: d649cc83acd8949163b82b837272d654140141b1d9b272fb18084195b20b6195
Contents?: true
Size: 1.54 KB
Versions: 3
Compression:
Stored size: 1.54 KB
Contents
# frozen_string_literal: true module Rails class Command class Serve < ShopifyCLI::SubCommand include ShopifyCLI::CommandOptions::CommandServeOptions prerequisite_task ensure_project_type: :rails prerequisite_task :ensure_env, :ensure_dev_store parse_host_option parse_port_option def call(*) project = ShopifyCLI::Project.current tunnel_port = port.to_s url = host || ShopifyCLI::Tunnel.start(@ctx, port: tunnel_port) project.env.update(@ctx, :host, url) ShopifyCLI::Tasks::UpdateDashboardURLS.call( @ctx, url: url, callback_url: "/auth/shopify/callback", ) if project.env.shop project_url = "#{project.env.host}/login?shop=#{project.env.shop}" @ctx.puts("\n" + @ctx.message("rails.serve.open_info", project_url) + "\n") end CLI::UI::Frame.open(@ctx.message("rails.serve.running_server")) do env = ShopifyCLI::Project.current.env.to_h env.delete("HOST") env["PORT"] = tunnel_port env["GEM_PATH"] = Gem.gem_path(@ctx) if @ctx.windows? @ctx.system("ruby bin\\rails server", env: env) else @ctx.system("bin/rails server", env: env) end end end def self.help ShopifyCLI::Context.message("rails.serve.help", ShopifyCLI::TOOL_NAME) end def self.extended_help ShopifyCLI::Context.message("rails.serve.extended_help", ShopifyCLI::TOOL_NAME) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
shopify-cli-2.6.6 | lib/project_types/rails/commands/serve.rb |
shopify-cli-2.6.5 | lib/project_types/rails/commands/serve.rb |
shopify-cli-2.6.4 | lib/project_types/rails/commands/serve.rb |