Sha256: 51f06d8dc2b3bc0f7d50e868007e1d2d3279dc3fca29c0a147b021acaa6b14c9

Contents?: true

Size: 794 Bytes

Versions: 11

Compression:

Stored size: 794 Bytes

Contents

# frozen_string_literal: true
require "shopify_cli"

module Extension
  module Commands
    class Build < ExtensionCommand
      hidden_feature

      YARN_BUILD_COMMAND = %w(build)
      NPM_BUILD_COMMAND = %w(run-script build)

      def call(_args, _command_name)
        system = ShopifyCli::JsSystem.new(ctx: @ctx)

        CLI::UI::Frame.open(@ctx.message("build.frame_title", system.package_manager)) do
          success = system.call(yarn: YARN_BUILD_COMMAND, npm: NPM_BUILD_COMMAND)
          @ctx.abort(@ctx.message("build.build_failure_message")) unless success
        end
      end

      def self.help
        <<~HELP
          Build your extension to prepare for deployment.
            Usage: {{command:#{ShopifyCli::TOOL_NAME} build}}
        HELP
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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