Don't use the RC file, use the JSOn state file

This commit is contained in:
Mitchell Hashimoto 2013-02-03 12:53:52 -08:00
parent bc54875a25
commit 693b825eb1
1 changed files with 8 additions and 7 deletions

View File

@ -15,7 +15,6 @@ module Vagrant
class Environment class Environment
DEFAULT_HOME = "~/.vagrant.d" DEFAULT_HOME = "~/.vagrant.d"
DEFAULT_LOCAL_DATA = ".vagrant" DEFAULT_LOCAL_DATA = ".vagrant"
DEFAULT_RC = "~/.vagrantrc"
# The `cwd` that this environment represents # The `cwd` that this environment represents
attr_reader :cwd attr_reader :cwd
@ -598,12 +597,14 @@ module Vagrant
::Gem.clear_paths ::Gem.clear_paths
# Load the plugins # Load the plugins
rc_path = File.expand_path(ENV["VAGRANT_RC"] || DEFAULT_RC) plugins_json_file = @home_path.join("plugins.json")
if File.file?(rc_path) && @@loaded_rc.add?(rc_path) @logger.debug("Loading plugins from: #{plugins_json_file}")
@logger.debug("Loading RC file: #{rc_path}") if plugins_json_file.file?
load rc_path data = JSON.parse(plugins_json_file.read)
else data["installed"].each do |plugin|
@logger.debug("RC file not found. Not loading: #{rc_path}") @logger.info("Loading plugin from JSON: #{plugin}")
Vagrant.require_plugin(plugin)
end
end end
end end