plugins/synced_folders/rsync/command/rsync_auto.rb in vagrant-unbundled-1.9.5.1 vs plugins/synced_folders/rsync/command/rsync_auto.rb in vagrant-unbundled-1.9.7.1

- old
+ new

@@ -46,10 +46,13 @@ # Build up the paths that we need to listen to. paths = {} ignores = [] with_target_vms(argv) do |machine| + next if machine.state.id == :not_created + cwd = machine.env.cwd.to_s + if machine.provider.capability?(:proxy_machine) proxy = machine.provider.capability(:proxy_machine) if proxy machine.ui.warn(I18n.t( "vagrant.rsync_proxy_machine", @@ -67,9 +70,24 @@ machine.ui.warn(I18n.t("vagrant.rsync_auto_new_folders")) end folders = cached[:rsync] next if !folders || folders.empty? + + # NOTE: This check is required with boot2docker since all containers + # share the same virtual machine. This prevents rsync-auto from + # syncing all known containers with rsync to the boot2docker vm + # and only syncs the current working dirs folders. + sync_folders = {} + folders.each do |id, folder_opts| + if cwd != folder_opts[:hostpath] + machine.ui.info(I18n.t("vagrant.rsync_auto_remove_folder", + folder: folder_opts[:hostpath])) + else + sync_folders[id] = folder_opts + end + end + folders = sync_folders # Get the SSH info for this machine so we can do an initial # sync to the VM. ssh_info = machine.ssh_info if ssh_info