command/rsync-auto: work with provisioner synced folders

This commit is contained in:
Mitchell Hashimoto 2014-04-18 17:03:28 -07:00
parent d2e2ccb625
commit 53017bccc8
2 changed files with 12 additions and 1 deletions

View File

@ -42,7 +42,14 @@ module VagrantPlugins
paths = {} paths = {}
ignores = [] ignores = []
with_target_vms(argv) do |machine| with_target_vms(argv) do |machine|
folders = synced_folders(machine)[:rsync] cached = synced_folders(machine, cached: true)
fresh = synced_folders(machine)
diff = synced_folders_diff(cached, fresh)
if !diff[:added].empty?
machine.ui.warn(I18n.t("vagrant.rsync_auto_new_folders"))
end
folders = cached[:rsync]
next if !folders || folders.empty? next if !folders || folders.empty?
# Get the SSH info for this machine so we can do an initial # Get the SSH info for this machine so we can do an initial

View File

@ -174,6 +174,10 @@ en:
Running cleanup tasks for '%{name}' provisioner... Running cleanup tasks for '%{name}' provisioner...
rsync_auto_initial: |- rsync_auto_initial: |-
Doing an initial rsync... Doing an initial rsync...
rsync_auto_new_folders: |-
New synced folders were added to the Vagrantfile since running
`vagrant reload`. If these new synced folders are backed by rsync,
they won't be automatically synced until a `vagrant reload` is run.
rsync_auto_no_paths: |- rsync_auto_no_paths: |-
There are no paths to watch! This is either because you have no There are no paths to watch! This is either because you have no
synced folders using rsync, or any rsync synced folders you have synced folders using rsync, or any rsync synced folders you have