diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-08-05 10:51:41 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-08-05 10:51:41 -0500 |
commit | 64bc84e82692dd2e6b65c19e5cb42e41ef8852f1 (patch) | |
tree | 306682646999dff1f5899372ad6420fc191a163a | |
parent | e23ea1519cfd9164053cb0eca84c3447ed6a2d57 (diff) | |
download | bundler-64bc84e82692dd2e6b65c19e5cb42e41ef8852f1.tar.gz |
[Setup] Only add bundler to the load path if we havent trampolinedseg-setup-trampoline
-rw-r--r-- | lib/bundler/postit_trampoline.rb | 6 | ||||
-rw-r--r-- | lib/bundler/setup.rb | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/bundler/postit_trampoline.rb b/lib/bundler/postit_trampoline.rb index 950a77341f..dbb23aa4d9 100644 --- a/lib/bundler/postit_trampoline.rb +++ b/lib/bundler/postit_trampoline.rb @@ -53,9 +53,9 @@ The error was: #{e} nil end - if Gem::Requirement.new(">= 1.13.pre".dup).satisfied_by?(Gem::Version.new(running_version)) - ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"] = installed_version.to_s - elsif ARGV.empty? || ARGV.any? {|a| %w(install i).include? a } + ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"] = installed_version.to_s + + if !Gem::Requirement.new(">= 1.13.pre".dup).satisfied_by?(Gem::Version.new(running_version)) && (ARGV.empty? || ARGV.any? {|a| %w(install i).include? a }) puts <<-WARN.strip You're running Bundler #{installed_version} but this project uses #{running_version}. To update, run `bundle update --bundler`. WARN diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb index c888dabf2c..8b4b479778 100644 --- a/lib/bundler/setup.rb +++ b/lib/bundler/setup.rb @@ -20,9 +20,12 @@ if Bundler::SharedHelpers.in_bundle? Bundler.setup end - # Add bundler to the load path after disabling system gems - bundler_lib = File.expand_path("../..", __FILE__) - $LOAD_PATH.unshift(bundler_lib) unless $LOAD_PATH.include?(bundler_lib) + unless ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"] + # Add bundler to the load path after disabling system gems + # This is guarenteed to be done already if we've trampolined + bundler_lib = File.expand_path("../..", __FILE__) + $LOAD_PATH.unshift(bundler_lib) unless $LOAD_PATH.include?(bundler_lib) + end Bundler.ui = nil end |