Merge pull request #11880 from elastio/bug/11878-rsync-fails-on-windows
[WIP] Change `mkdir` command on Windows for rsync
This commit is contained in:
commit
f9d1025688
@ -13,7 +13,11 @@ module VagrantPlugins
|
|||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
# rsync does not construct any gaps in the path to the target directory
|
# rsync does not construct any gaps in the path to the target directory
|
||||||
# make sure that all subdirectories are created
|
# make sure that all subdirectories are created
|
||||||
comm.execute("mkdir -p '#{opts[:guestpath]}'")
|
# NB: Per #11878, the `mkdir` command on Windows is different than used on Unix.
|
||||||
|
# This formulation matches the form used in the WinRM communicator plugin.
|
||||||
|
# This will ignore any -p switches, which are redundant in PowerShell,
|
||||||
|
# and ambiguous in PowerShell 4+
|
||||||
|
comm.execute("mkdir \"#{opts[:guestpath]}\" -force")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -19,7 +19,7 @@ describe "VagrantPlugins::GuestWindows::Cap::RSync" do
|
|||||||
|
|
||||||
describe ".rsync_pre" do
|
describe ".rsync_pre" do
|
||||||
it 'makes the guestpath directory with mkdir' do
|
it 'makes the guestpath directory with mkdir' do
|
||||||
communicator.expect_command("mkdir -p '/sync_dir'")
|
communicator.expect_command("mkdir \"/sync_dir\" -force")
|
||||||
described_class.rsync_pre(machine, guestpath: '/sync_dir')
|
described_class.rsync_pre(machine, guestpath: '/sync_dir')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user