Sha256: 0a0258b81b41bc85fd0791e407a20ca4f3724349c48db8fd508de78300489892

Contents?: true

Size: 868 Bytes

Versions: 77

Compression:

Stored size: 868 Bytes

Contents

Gem.post_uninstall do |uninstaller|
  if uninstaller.spec.name == "shopify-cli"
    if RUBY_PLATFORM.match(/mingw32/)
      bat_path = File.dirname(RbConfig.ruby)
      bat = "#{bat_path}\\shopify.bat"

      # delete the auto-generated batch script
      File.unlink(bat)
    else
      require "fileutils"

      symlink = "/usr/local/bin/shopify"

      # delete the symbolic link IFF it exists AND it does not point to a file
      # (i.e., it's been left hanging as a result of the uninstall, as expected)
      #
      # if the file still exists, either the uninstall failed (possible but
      # unlikely) OR
      # there's another installation of the gem in another ruby folder that has
      # overwritten it, so leave the symbolic link alone
      system("sudo rm -f #{symlink}") if File.symlink?(symlink) && !File.exist?(symlink)
    end
  end

  true
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/rubygems_plugin.rb
shopify-cli-2.35.0 lib/rubygems_plugin.rb
shopify-cli-2.34.0 lib/rubygems_plugin.rb
shopify-cli-2.33.1 lib/rubygems_plugin.rb
shopify-cli-2.33.0 lib/rubygems_plugin.rb
shopify-cli-2.32.1 lib/rubygems_plugin.rb
shopify-cli-2.32.0 lib/rubygems_plugin.rb
shopify-cli-2.31.0 lib/rubygems_plugin.rb
shopify-cli-2.30.0 lib/rubygems_plugin.rb
shopify-cli-2.29.0 lib/rubygems_plugin.rb
shopify-cli-2.28.0 lib/rubygems_plugin.rb
shopify-cli-2.27.0 lib/rubygems_plugin.rb
shopify-cli-2.26.0 lib/rubygems_plugin.rb
shopify-cli-2.25.0 lib/rubygems_plugin.rb
shopify-cli-2.24.0 lib/rubygems_plugin.rb
shopify-cli-2.23.0 lib/rubygems_plugin.rb
shopify-cli-2.22.0 lib/rubygems_plugin.rb
shopify-cli-2.21.0 lib/rubygems_plugin.rb
shopify-cli-2.20.1 lib/rubygems_plugin.rb
shopify-cli-2.20.0 lib/rubygems_plugin.rb