core: execute the specified Vagrant executable in pre-rubygems.rb

This commit is contained in:
Mitchell Hashimoto 2014-02-01 16:28:45 +01:00
parent 24a03de8bf
commit bc55081e9f
1 changed files with 9 additions and 1 deletions

View File

@ -21,4 +21,12 @@ plugins = Vagrant::Plugin::Manager.instance.installed_plugins
Vagrant::Bundler.instance.init!(plugins)
ENV["VAGRANT_INTERNAL_BUNDLERIZED"] = "1"
Kernel.exec("vagrant", *ARGV)
# If the VAGRANT_EXECUTABLE env is set, then we use that to point to a
# Ruby file to directly execute. Otherwise, we just depend on PATH lookup.
# This minor optimization can save hundreds of milliseconds on Windows.
if ENV["VAGRANT_EXECUTABLE"]
Kernel.exec("ruby", ENV["VAGRANT_EXECUTABLE"], *ARGV)
else
Kernel.exec("vagrant", *ARGV)
end