Allow Vagrantfile to load when using --local
This commit is contained in:
parent
78bf131dc8
commit
737ef0eded
|
@ -44,7 +44,9 @@ argv.each_index do |i|
|
|||
|
||||
# Do not load plugins when performing plugin operations
|
||||
if arg == "plugin"
|
||||
opts[:vagrantfile_name] = ""
|
||||
if argv.none?{|a| a == "--local" }
|
||||
opts[:vagrantfile_name] = ""
|
||||
end
|
||||
ENV['VAGRANT_NO_PLUGINS'] = "1"
|
||||
# Only initialize plugins when listing installed plugins
|
||||
if argv[i+1] != "list"
|
||||
|
|
|
@ -143,5 +143,14 @@ describe "vagrant bin" do
|
|||
expect(ENV).not_to receive(:[]=).with("VAGRANT_DISABLE_PLUGIN_INIT", "1")
|
||||
end
|
||||
end
|
||||
|
||||
context "--local" do
|
||||
let(:argv) { ["plugin", "install", "--local"] }
|
||||
|
||||
it "should not unset vagrantfile" do
|
||||
expect(Vagrant::Environment).to receive(:new).
|
||||
with(hash_excluding(vagrantfile_name: "")).and_return(env)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue