From 630858b9a8fee433d94705961503ead5748b0c8e Mon Sep 17 00:00:00 2001 From: Tim Aslat Date: Tue, 16 May 2017 16:38:29 +0930 Subject: [PATCH] This patch fixes an issue when using rsync folders on windows clients with cygwin & ssh enabled. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before the patch this error will happen if the original directory already exists ------------------------------------------------------------------------------------------------- ==> windows: Rsyncing folder: /vhosts/oxfamshop.com.au/ => /cygdrive/c/inetpub/wwwroot ==> windows: - Exclude: [".vagrant/", ".git/", "target/", "node_modules/"] ==> windows: Showing rsync output... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! mkdir '/cygdrive/c/inetpub/wwwroot' Stdout from the command: Stderr from the command: mkdir: cannot create directory ‘/cygdrive/c/inetpub/wwwroot’: File exists ------------------------------------------------------------------------------------------------- After the patch, this is result ------------------------------------------------------------------------------------------------- ==> windows: Rsyncing folder: /vhosts/oxfamshop.com.au/ => /cygdrive/c/inetpub/wwwroot ==> windows: - Exclude: [".vagrant/", ".git/", "target/", "node_modules/"] ==> windows: Showing rsync output... ==> windows: rsync[stdout] -> sending incremental file list ==> windows: rsync[stdout] -> ==> windows: rsync[stdout] -> sent 500855 bytes received 6635 bytes 78075.38 bytes/sec ==> windows: rsync[stdout] -> total size is 175357552 speedup is 345.54 ------------------------------------------------------------------------------------------------- --- plugins/guests/windows/cap/rsync.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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