diff options
author | Boggs <hello@boggs.xyz> | 2016-07-25 04:35:47 +0800 |
---|---|---|
committer | Boggs <hello@boggs.xyz> | 2016-07-29 11:42:00 +0800 |
commit | 478294a50e815385efe7fd425df618b9675efc45 (patch) | |
tree | 060dce9d6c1d1b088dcba11b400027dab493b13e | |
parent | 54f9823952b4305dc811217556f9450030b5276f (diff) | |
download | bundler-478294a50e815385efe7fd425df618b9675efc45.tar.gz |
Only run `installer.install!` if `installer.installed?` is false
Move message into non-vendor file
-rw-r--r-- | lib/bundler/postit_trampoline.rb | 5 | ||||
-rw-r--r-- | lib/bundler/vendor/postit/lib/postit/installer.rb | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/postit_trampoline.rb b/lib/bundler/postit_trampoline.rb index 5f90ffa0a0..40f48ec68e 100644 --- a/lib/bundler/postit_trampoline.rb +++ b/lib/bundler/postit_trampoline.rb @@ -20,7 +20,10 @@ if ENV["BUNDLE_ENABLE_TRAMPOLINE"] if !version.satisfied_by?(installed_version) begin installer = BundlerVendoredPostIt::PostIt::Installer.new(version) - installer.install! + unless installer.installed? + warn "Installing locked Bundler version #{version}" + installer.install! + end rescue => e abort <<-EOS.strip Installing the inferred bundler version (#{version}) failed. diff --git a/lib/bundler/vendor/postit/lib/postit/installer.rb b/lib/bundler/vendor/postit/lib/postit/installer.rb index 98e4099c30..5fa34b6938 100644 --- a/lib/bundler/vendor/postit/lib/postit/installer.rb +++ b/lib/bundler/vendor/postit/lib/postit/installer.rb @@ -19,7 +19,6 @@ module BundlerVendoredPostIt::PostIt def install! return if installed? - puts "Installing locked Bundler version #{@bundler_version}" require 'rubygems/dependency_installer' installer = Gem::DependencyInstaller.new installer.install('bundler', @bundler_version) |