Merge pull request #5282 from Scythril/windows_rsync_pre
guests/windows: windows rsync needs to create folders before syncing
This commit is contained in:
commit
8e76ff64d2
|
@ -0,0 +1,13 @@
|
||||||
|
module VagrantPlugins
|
||||||
|
module GuestWindows
|
||||||
|
module Cap
|
||||||
|
class RSync
|
||||||
|
def self.rsync_pre(machine, opts)
|
||||||
|
machine.communicate.tap do |comm|
|
||||||
|
comm.execute("mkdir '#{opts[:guestpath]}'")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -64,6 +64,11 @@ module VagrantPlugins
|
||||||
Cap::MountSharedFolder
|
Cap::MountSharedFolder
|
||||||
end
|
end
|
||||||
|
|
||||||
|
guest_capability(:windows, :rsync_pre) do
|
||||||
|
require_relative "cap/rsync"
|
||||||
|
Cap::RSync
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def self.init!
|
def self.init!
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
require File.expand_path("../../../../../base", __FILE__)
|
||||||
|
|
||||||
|
require Vagrant.source_root.join("plugins/guests/windows/cap/rsync")
|
||||||
|
|
||||||
|
describe "VagrantPlugins::GuestWindows::Cap::RSync" do
|
||||||
|
let(:described_class) do
|
||||||
|
VagrantPlugins::GuestWindows::Plugin.components.guest_capabilities[:windows].get(:rsync_pre)
|
||||||
|
end
|
||||||
|
let(:machine) { double("machine") }
|
||||||
|
let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
allow(machine).to receive(:communicate).and_return(communicator)
|
||||||
|
end
|
||||||
|
|
||||||
|
after do
|
||||||
|
communicator.verify_expectations!
|
||||||
|
end
|
||||||
|
|
||||||
|
describe ".rsync_pre" do
|
||||||
|
it 'makes the guestpath directory with mkdir' do
|
||||||
|
communicator.expect_command("mkdir '/sync_dir'")
|
||||||
|
described_class.rsync_pre(machine, guestpath: '/sync_dir')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue