diff --git a/plugins/synced_folders/rsync/command/rsync_auto.rb b/plugins/synced_folders/rsync/command/rsync_auto.rb index 3d3cd226c..8bb658c5d 100644 --- a/plugins/synced_folders/rsync/command/rsync_auto.rb +++ b/plugins/synced_folders/rsync/command/rsync_auto.rb @@ -42,7 +42,14 @@ module VagrantPlugins paths = {} ignores = [] 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? # Get the SSH info for this machine so we can do an initial diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 31c0ff85a..5db009598 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -174,6 +174,10 @@ en: Running cleanup tasks for '%{name}' provisioner... rsync_auto_initial: |- 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: |- There are no paths to watch! This is either because you have no synced folders using rsync, or any rsync synced folders you have