From 76de267d1ec9051b137fe05e926016753b9e0843 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 5 Jan 2014 16:04:53 -0800 Subject: [PATCH] Don't load plugins again on `vagrant plugin` commands --- bin/vagrant | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/bin/vagrant b/bin/vagrant index 0f017ee69..ef6789565 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -39,6 +39,21 @@ if argv.include?("--debug") ENV["VAGRANT_LOG"] = "debug" end +# This is kind of hacky, and I'd love to find a better way to do this, but +# if we're accessing the plugin interface, we want to NOT load plugins +# for this run, because they can actually interfere with the function +# of the plugin interface. +argv.each do |arg| + if !arg.start_with?("-") + if arg == "plugin" + ENV["VAGRANT_NO_PLUGINS"] = "1" + ENV["VAGRANT_VAGRANTFILE"] = "plugin_command_#{Time.now.to_i}" + end + + break + end +end + # Setup our dependencies by initializing Bundler require "bundler" Bundler.setup @@ -95,21 +110,6 @@ end # Default to colored output opts[:ui_class] ||= Vagrant::UI::Colored -# This is kind of hacky, and I'd love to find a better way to do this, but -# if we're accessing the plugin interface, we want to NOT load plugins -# for this run, because they can actually interfere with the function -# of the plugin interface. -argv.each do |arg| - if !arg.start_with?("-") - if arg == "plugin" - ENV["VAGRANT_NO_PLUGINS"] = "1" - ENV["VAGRANT_VAGRANTFILE"] = "plugin_command_#{Time.now.to_i}" - end - - break - end -end - # Recombine the arguments argv << "--" argv += argv_extra