aboutsummaryrefslogtreecommitdiffstats
path: root/exe
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-06-05 18:52:58 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-06-10 01:42:17 -0500
commitcfbe2b4b272242b404a6abb318edde030447707a (patch)
treed7562f75224cf57fad2b45b44495c63dad91621c /exe
parent8c1b9e77b08b52018a7b1b38d51dcbcd168938f4 (diff)
downloadbundler-cfbe2b4b272242b404a6abb318edde030447707a.tar.gz
Add total bundler version trampolining via vendored postit
Diffstat (limited to 'exe')
-rwxr-xr-xexe/bundle11
1 files changed, 7 insertions, 4 deletions
diff --git a/exe/bundle b/exe/bundle
index 00479062..51a9035d 100755
--- a/exe/bundle
+++ b/exe/bundle
@@ -4,6 +4,13 @@
# Exit cleanly from an early interrupt
Signal.trap("INT") { exit 1 }
+unless ENV["BUNDLE_DISABLE_POSTIT"]
+ update = "update".start_with?(ARGV.first || " ") && ARGV.find {|a| a.start_with?("--bundler") }
+ update &&= update =~ /--bundler(?:=(.+))?/ && $1 || "> 0.a"
+ ENV["BUNDLER_VERSION"] = update if update
+ require "bundler/postit_trampoline"
+end
+
require "bundler"
# Check if an older version of bundler is installed
$LOAD_PATH.each do |path|
@@ -17,10 +24,6 @@ end
require "bundler/friendly_errors"
Bundler.with_friendly_errors do
- if !"exec".start_with?(ARGV.first || " ") && postit = Gem.bin_path("postit", "postit")
- Kernel.exec(postit, *ARGV)
- end
-
require "bundler/cli"
# Allow any command to use --help flag to show help for that command