Disable plugins on plugin commands but allow init when listing

This commit is contained in:
Chris Roberts 2018-05-08 13:46:44 -07:00
parent addc7576cc
commit 1bba1f86bb
1 changed files with 8 additions and 3 deletions

View File

@ -37,13 +37,18 @@ argv.each_index do |i|
arg = argv[i]
if !arg.start_with?("-")
if ["plugin", "help"].include?(arg) || (arg == "box" && argv[i+1] == "list")
if arg == "box" && argv[i+1] == "list"
opts[:vagrantfile_name] = ""
ENV['VAGRANT_NO_PLUGINS'] = "1"
end
if arg == "plugin" && argv[i+1] != "list"
ENV['VAGRANT_DISABLE_PLUGIN_INIT'] = "1"
# Do not load plugins when performing plugin operations
if arg == "plugin"
ENV['VAGRANT_NO_PLUGINS'] = "1"
# Only initialize plugins when listing installed plugins
if argv[i+1] != "list"
ENV['VAGRANT_DISABLE_PLUGIN_INIT'] = "1"
end
end
break