From 09a3409746f741db72143e64a4572780c8cd51bd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 9 Apr 2014 09:09:42 -0700 Subject: [PATCH] commands/rsync-auto: do an initial sync [GH-3327] --- CHANGELOG.md | 4 ++++ plugins/synced_folders/rsync/command/rsync_auto.rb | 10 ++++++++++ templates/locales/en.yml | 2 ++ 3 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1515dfa72..8dc1a5666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 1.5.3 (unreleased) +IMPROVEMENTS: + + - commands/rsync-auto: An initial sync is done before watching folders. [GH-3327] + BUG FIXES: - core: Randomize some filenames internally to improve the parallelism diff --git a/plugins/synced_folders/rsync/command/rsync_auto.rb b/plugins/synced_folders/rsync/command/rsync_auto.rb index 48ac287e5..0a7a53c6f 100644 --- a/plugins/synced_folders/rsync/command/rsync_auto.rb +++ b/plugins/synced_folders/rsync/command/rsync_auto.rb @@ -36,6 +36,16 @@ module VagrantPlugins folders = synced_folders(machine)[:rsync] next if !folders || folders.empty? + # 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 + machine.ui.info(I18n.t("vagrant.rsync_auto_initial")) + folders.each do |id, folder_opts| + RsyncHelper.rsync_single(machine, ssh_info, folder_opts) + end + end + folders.each do |id, folder_opts| # If we marked this folder to not auto sync, then # don't do it. diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 487c9a87d..479afbd0d 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -154,6 +154,8 @@ en: %{names} provisioner_cleanup: |- Running cleanup tasks for '%{name}' provisioner... + rsync_auto_initial: |- + Doing an initial rsync... rsync_auto_path: |- Watching: %{path} rsync_communicator_not_ready: |-