Disable plugins on plugin commands but allow init when listing
This commit is contained in:
parent
addc7576cc
commit
1bba1f86bb
11
bin/vagrant
11
bin/vagrant
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue