Sha256: 45ea30e58308d96eb8a658e9316760d9ed19a894d35de091963c249c823ed7e5

Contents?: true

Size: 1 KB

Versions: 11

Compression:

Stored size: 1 KB

Contents

require "rbconfig"
require "fileutils"

gem = File.expand_path("../../../", __FILE__)
exe = File.join(gem, "bin", "shopify")

if RUBY_PLATFORM.match(/mingw32/)
  bat_path = File.dirname(RbConfig.ruby)
  bat = "#{bat_path}\\shopify.bat"

  script_content = "#{RbConfig.ruby} --disable=gems -I '#{gem}' '#{exe}' %*"

  FileUtils.mkdir_p(bat_path)
  makefile_content = <<~MAKEFILE
    .PHONY: clean install

    clean:
    \t rm -f "#{bat}"

    install: clean
    \t echo "@ECHO OFF"> "#{bat}"
    \t echo "#{script_content}">> "#{bat}"
  MAKEFILE
else
  script = exe + ".sh"
  symlink = "/usr/local/bin/shopify"

  script_content = <<~SCRIPT
    #!/usr/bin/env bash
    #{RbConfig.ruby} --disable=gems -I #{gem} #{exe} $@
  SCRIPT

  File.write(script, script_content)
  FileUtils.chmod("+x", script)

  makefile_content = <<~MAKEFILE
    .PHONY: clean install
    
    clean:
    \t@sudo rm -f #{symlink}
    
    install: clean
    \t@sudo ln -s #{script} #{symlink}
  MAKEFILE
end

File.write("Makefile", makefile_content)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shopify-cli-1.14.0 ext/shopify-cli/extconf.rb
shopify-cli-1.13.1 ext/shopify-cli/extconf.rb
shopify-cli-1.13.0 ext/shopify-cli/extconf.rb
shopify-cli-1.12.0 ext/shopify-cli/extconf.rb
shopify-cli-1.11.0 ext/shopify-cli/extconf.rb
shopify-cli-1.10.0 ext/shopify-cli/extconf.rb
shopify-cli-1.9.1 ext/shopify-cli/extconf.rb
shopify-cli-1.9.0 ext/shopify-cli/extconf.rb
shopify-cli-1.8.0 ext/shopify-cli/extconf.rb
shopify-cli-1.7.1 ext/shopify-cli/extconf.rb
shopify-cli-1.7.0 ext/shopify-cli/extconf.rb