Sha256: 76586785b1588b6b9354a76983a62f63d04fffe738ac2555c2f89e70874def38

Contents?: true

Size: 824 Bytes

Versions: 34

Compression:

Stored size: 824 Bytes

Contents

# frozen_string_literal: true
require "shopify_cli"
require_relative "../../../../ext/javy/javy.rb"

module Script
  class Command
    class Javy < ShopifyCLI::Command::SubCommand
      hidden_feature

      options do |parser, flags|
        parser.on("--in=IN") { |in_file| flags[:in_file] = in_file }
        parser.on("--out=OUT") { |out_file| flags[:out_file] = out_file }
      end

      def call(*)
        source = options.flags[:in_file]
        dest = options.flags[:out_file]

        @ctx.abort(@ctx.message("script.javy.errors.invalid_arguments", ShopifyCLI::TOOL_NAME)) unless source

        ::Javy.build(source: source, dest: dest).unwrap { |e| @ctx.abort(e.message) }
      end

      def self.help
        ShopifyCLI::Context.message("script.javy.help", ShopifyCLI::TOOL_NAME)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
shopify-cli-2.25.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.24.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.23.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.22.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.21.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.20.1 lib/project_types/script/commands/javy.rb
shopify-cli-2.20.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.19.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.18.1 lib/project_types/script/commands/javy.rb
shopify-cli-2.18.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.17.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.16.1 lib/project_types/script/commands/javy.rb
shopify-cli-2.16.0 lib/project_types/script/commands/javy.rb
shopify-cli-2.15.6 lib/project_types/script/commands/javy.rb
shopify-cli-2.15.5 lib/project_types/script/commands/javy.rb
shopify-cli-2.15.4 lib/project_types/script/commands/javy.rb
shopify-cli-2.15.3 lib/project_types/script/commands/javy.rb
shopify-cli-2.15.2 lib/project_types/script/commands/javy.rb
shopify-cli-2.15.1 lib/project_types/script/commands/javy.rb
shopify-cli-2.15.0 lib/project_types/script/commands/javy.rb