Sha256: 23f83218e6a7762d0d8c5239add76fc3ea4ad39225bb97409964010361ab721a

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

#!/usr/bin/env ruby --disable=gems

module Kernel
  # make an alias of the original require
  alias_method :original_require, :require

  # rewrite require
  def require(name)
    original_require(name)
  rescue LoadError => e
    # Special case for readline.so, which fails harmlessly on Windows
    raise if (name == "readline.so") && ShopifyCli::Context.new.windows?
    # Special case for psych (yaml), which rescues this itself
    raise if name == "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
    STDERR.puts "[Note] You cannot use gems with Shopify App CLI."
    STDERR.puts "[LoadError] #{e.message}"
    if ENV["DEBUG"]
      STDERR.puts e.backtrace
      STDERR.puts "\n"
    end
    STDERR.puts "       They are disabled."
    STDERR.puts "       Please don't modify the CLI locally."
    STDERR.puts "       If you would like to contribute to the CLI project, please refer to"
    STDERR.puts "       https://github.com/Shopify/shopify-app-cli/blob/master/.github/CONTRIBUTING.md"
    STDERR.puts "\n"
    raise
  end
end

require_relative "./load_shopify"

exit(ShopifyCli::ErrorHandler.call do
  ShopifyCli::Core::EntryPoint.call(ARGV.dup)
end)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shopify-cli-1.14.0 bin/shopify
shopify-cli-1.13.1 bin/shopify
shopify-cli-1.13.0 bin/shopify
shopify-cli-1.12.0 bin/shopify
shopify-cli-1.11.0 bin/shopify
shopify-cli-1.10.0 bin/shopify
shopify-cli-1.9.1 bin/shopify
shopify-cli-1.9.0 bin/shopify
shopify-cli-1.8.0 bin/shopify
shopify-cli-1.7.1 bin/shopify
shopify-cli-1.7.0 bin/shopify