diff --git a/plugins/guests/windows/cap/rsync.rb b/plugins/guests/windows/cap/rsync.rb index aa9f1bcdf..bf2456249 100644 --- a/plugins/guests/windows/cap/rsync.rb +++ b/plugins/guests/windows/cap/rsync.rb @@ -13,7 +13,7 @@ module VagrantPlugins machine.communicate.tap do |comm| # rsync does not construct any gaps in the path to the target directory # make sure that all subdirectories are created - comm.execute("mkdir '#{opts[:guestpath]}'") + comm.execute("mkdir -p '#{opts[:guestpath]}'") end end end diff --git a/test/unit/plugins/guests/windows/cap/rsync_test.rb b/test/unit/plugins/guests/windows/cap/rsync_test.rb index d32568c40..e55006512 100644 --- a/test/unit/plugins/guests/windows/cap/rsync_test.rb +++ b/test/unit/plugins/guests/windows/cap/rsync_test.rb @@ -19,7 +19,7 @@ describe "VagrantPlugins::GuestWindows::Cap::RSync" do describe ".rsync_pre" do it 'makes the guestpath directory with mkdir' do - communicator.expect_command("mkdir '/sync_dir'") + communicator.expect_command("mkdir -p '/sync_dir'") described_class.rsync_pre(machine, guestpath: '/sync_dir') end end