From bc55081e9ffaa6820113e449a9f76b293a29b27d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 1 Feb 2014 16:28:45 +0100 Subject: [PATCH] core: execute the specified Vagrant executable in pre-rubygems.rb --- lib/vagrant/pre-rubygems.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/pre-rubygems.rb b/lib/vagrant/pre-rubygems.rb index 451fdd263..5ea8a28e6 100644 --- a/lib/vagrant/pre-rubygems.rb +++ b/lib/vagrant/pre-rubygems.rb @@ -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