Don't load plugins.json plugins in Bundler env

This commit is contained in:
Mitchell Hashimoto 2013-03-28 17:02:54 -07:00
parent 64921db66f
commit 72e0a691db
2 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,9 @@
IMPROVEMENTS:
- More robust SSH connection close detection.
- Don't load `vagrant plugin` installed plugins when in a Bundler
environment. This happens during plugin development. This will make
Vagrant errors much quieter when developing plugins.
BUG FIXES:

View File

@ -636,6 +636,16 @@ module Vagrant
ENV["GEM_PATH"] = "#{@gems_path}#{::File::PATH_SEPARATOR}#{ENV["GEM_PATH"]}"
::Gem.clear_paths
# If we're in a Bundler environment, don't load plugins. This only
# happens in plugin development environments.
if defined?(Bundler)
require 'bundler/shared_helpers'
if Bundler::SharedHelpers.in_bundle?
@logger.warn("In a bundler environment, not loading environment plugins!")
return
end
end
# Load the plugins
plugins_json_file = @home_path.join("plugins.json")
@logger.debug("Loading plugins from: #{plugins_json_file}")