Skip to content

Commit 7861ba8

Browse files
Autoswitching won't work with -e
1 parent bc2a145 commit 7861ba8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bundler/lib/bundler/self_manager.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def needs_switching?
9292
def autoswitching_applies?
9393
ENV["BUNDLER_VERSION"].nil? &&
9494
Bundler.rubygems.supports_bundler_trampolining? &&
95+
ruby_can_restart_with_same_arguments? &&
9596
SharedHelpers.in_bundle? &&
9697
lockfile_version
9798
end
@@ -151,6 +152,10 @@ def released?(version)
151152
!version.to_s.end_with?(".dev")
152153
end
153154

155+
def ruby_can_restart_with_same_arguments?
156+
$PROGRAM_NAME != "-e"
157+
end
158+
154159
def updating?
155160
"update".start_with?(ARGV.first || " ") && ARGV[1..-1].any? {|a| a.start_with?("--bundler") }
156161
end

0 commit comments

Comments
 (0)