Sha256: 8806b1d3e824f1ab6d88d397d478a7d3cbb9439fd48242ba4ec80bede091f298

Contents?: true

Size: 1.43 KB

Versions: 18

Compression:

Stored size: 1.43 KB

Contents

#!/usr/bin/env ruby

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"
    # Special case for ffi, which rescues this itself
    raise if name == "#{RUBY_VERSION.split(".")[0, 2].join(".")}/ffi_c"
    STDERR.puts "[Note] You cannot use gems with Shopify 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-cli/blob/main/.github/CONTRIBUTING.md"
    STDERR.puts "\n"
    raise
  end
end

require_relative "./load_shopify"

exit(proc do
  begin
    ShopifyCLI::ErrorHandler.call do
      ShopifyCLI::Core::EntryPoint.call(ARGV.dup)
    end
  rescue StandardError => error
    ShopifyCLI::ErrorHandler.exception = error
    if ShopifyCLI::Environment.print_stacktrace?
      raise error
    else
      1
    end
  end
end.call)

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
shopify-cli-2.11.1 bin/shopify
shopify-cli-2.11.0 bin/shopify
shopify-cli-2.10.2 bin/shopify
shopify-cli-2.10.1 bin/shopify
shopify-cli-2.10.0 bin/shopify
shopify-cli-2.9.0 bin/shopify
shopify-cli-2.8.0 bin/shopify
shopify-cli-2.7.4 bin/shopify
shopify-cli-2.7.3 bin/shopify
shopify-cli-2.7.2 bin/shopify
shopify-cli-2.7.1 bin/shopify
shopify-cli-2.7.0 bin/shopify
shopify-cli-2.6.6 bin/shopify
shopify-cli-2.6.5 bin/shopify
shopify-cli-2.6.4 bin/shopify
shopify-cli-2.6.3 bin/shopify
shopify-cli-2.6.2 bin/shopify
shopify-cli-2.6.1 bin/shopify