Sha256: 0eb8bfe43aa14bc893481e16d594819f34e24042d99c16cc016ab9c97eb7c73c

Contents?: true

Size: 1.09 KB

Versions: 11

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true
module Theme
  module Commands
    class Deploy < 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 }
      end

      def call(*)
        CLI::UI::Frame.open(@ctx.message("theme.deploy.deploying")) do
          unless CLI::UI::Prompt.confirm(@ctx.message("theme.deploy.confirmation"))
            @ctx.abort(@ctx.message("theme.deploy.abort"))
          end

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

          flags = Themekit.add_flags(options.flags)

          unless Themekit.deploy(@ctx, flags: flags, env: env)
            @ctx.abort(@ctx.message("theme.deploy.error"))
          end
        end

        @ctx.done(@ctx.message("theme.deploy.info.deployed"))
      end

      def self.help
        ShopifyCli::Context.message("theme.deploy.help", ShopifyCli::TOOL_NAME, 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/deploy.rb
shopify-cli-1.13.1 lib/project_types/theme/commands/deploy.rb
shopify-cli-1.13.0 lib/project_types/theme/commands/deploy.rb
shopify-cli-1.12.0 lib/project_types/theme/commands/deploy.rb
shopify-cli-1.11.0 lib/project_types/theme/commands/deploy.rb
shopify-cli-1.10.0 lib/project_types/theme/commands/deploy.rb
shopify-cli-1.9.1 lib/project_types/theme/commands/deploy.rb
shopify-cli-1.9.0 lib/project_types/theme/commands/deploy.rb
shopify-cli-1.8.0 lib/project_types/theme/commands/deploy.rb
shopify-cli-1.7.1 lib/project_types/theme/commands/deploy.rb
shopify-cli-1.7.0 lib/project_types/theme/commands/deploy.rb