17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/syncer/command/rsync.rb', line 17
def execute
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant rsync [vm-name]"
o.separator ""
o.separator "This command forces any synced folders with type 'rsync' to sync."
o.separator "RSync is not an automatic sync so a manual command is used."
o.separator ""
o.separator "Options:"
o.separator ""
end
argv = parse_options(opts)
return unless argv
with_target_vms(argv) do |machine|
if machine.provider.capability?(:proxy_machine)
proxy = machine.provider.capability(:proxy_machine)
if proxy
machine.ui.warn(I18n.t(
"vagrant.rsync_proxy_machine",
name: machine.name.to_s,
provider: machine.provider_name.to_s))
machine = proxy
end
end
next unless machine.communicate.ready?
next unless synced_folders(machine)[:rsync]
if machine.ssh_info
Machine.new(machine).full_sync
end
end
return 0
end
|