diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-02-01 17:29:32 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-02-01 17:29:32 -0600 |
commit | 5b639c3d774e4a83f1a15ec15e16b3e777c79642 (patch) | |
tree | 1bb9829e4c5b330c2ae3b83580367dcb1d0570eb /lib/bundler/shared_helpers.rb | |
parent | 789dabcb48adf58175a75751c4aaf08e4c39e707 (diff) | |
download | bundler-5b639c3d774e4a83f1a15ec15e16b3e777c79642.tar.gz |
[Exec] Avoid loading the definition before exec-ing
Diffstat (limited to 'lib/bundler/shared_helpers.rb')
-rw-r--r-- | lib/bundler/shared_helpers.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index ca26f7b4..654359d1 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -75,6 +75,7 @@ module Bundler end def set_bundle_environment + set_bundle_variables set_path set_rubyopt set_rubylib @@ -155,6 +156,17 @@ module Bundler end end + def set_bundle_variables + begin + ENV["BUNDLE_BIN_PATH"] = Bundler.rubygems.bin_path("bundler", "bundle", VERSION) + rescue Gem::GemNotFoundException + ENV["BUNDLE_BIN_PATH"] = File.expand_path("../../../exe/bundle", __FILE__) + end + + # Set BUNDLE_GEMFILE + ENV["BUNDLE_GEMFILE"] = find_gemfile.to_s + end + def set_path paths = (ENV["PATH"] || "").split(File::PATH_SEPARATOR) paths.unshift "#{Bundler.bundle_path}/bin" |