Sha256: 8611a61da23b0d0fa9df0374cc3db809f9ec62398549f2b337ed39911a6f393c

Contents?: true

Size: 777 Bytes

Versions: 8

Compression:

Stored size: 777 Bytes

Contents

# frozen_string_literal: true
require "shopify_cli"

module Extension
  class Command
    class Build < ExtensionCommand
      hidden_feature

      prerequisite_task ensure_project_type: :extension

      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
        ShopifyCli::Context.new.message("build.help", ShopifyCli::TOOL_NAME)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shopify-cli-2.3.0 lib/project_types/extension/commands/build.rb
shopify-cli-2.2.2 lib/project_types/extension/commands/build.rb
shopify-cli-2.2.1 lib/project_types/extension/commands/build.rb
shopify-cli-2.2.0 lib/project_types/extension/commands/build.rb
shopify-cli-2.1.0 lib/project_types/extension/commands/build.rb
shopify-cli-2.0.2 lib/project_types/extension/commands/build.rb
shopify-cli-2.0.1 lib/project_types/extension/commands/build.rb
shopify-cli-2.0.0 lib/project_types/extension/commands/build.rb