Sha256: b1c3f4d0688618558dae354f596b4e2a04b50c112b7631bcae403b249ee7514f

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

#!/usr/bin/env jruby
# frozen_string_literal: true
lib_directory = File.expand_path('../../lib', __FILE__)
$LOAD_PATH << lib_directory

# We want the Gemfile alongside the Shoes code that we're executing, not
# necessarily the Gemfile in our current directory. This helps in both running
# and packaging apps that have their own Gemfiles, even if we run `shoes` from
# another location.
candidates = (ARGV + ["."]).map do |candidate|
  File.expand_path(File.join(File.dirname(candidate), "Gemfile"))
end

gemfile = candidates.uniq.find do |candidate|
  File.exist?(candidate)
end

if gemfile
  if defined?(Bundler) && gemfile != Bundler.default_gemfile.to_s
    puts <<~EOS
      Shoes wants to load the Gemfile from '#{gemfile}'
      But you've already loaded Gemfile at '#{Bundler.default_gemfile}'

      Instead of `bundle exec shoes`, try just `shoes` instead. We'll load Bundler for you.

    EOS
  end

  # Thanks Bundler for the ENV vars! <3
  ENV["BUNDLE_GEMFILE"] = gemfile
  require "bundler/setup"
  Bundler.require
end

require 'shoes/ui/cli'
Shoes::UI::CLI.new("swt").run ARGV

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shoes-swt-4.0.0.pre12 bin/shoes-swt
shoes-swt-4.0.0.pre11 bin/shoes-swt