diff --git a/plugins/synced_folders/rsync/command/rsync_auto.rb b/plugins/synced_folders/rsync/command/rsync_auto.rb index f6a939c6d..e495ce41e 100644 --- a/plugins/synced_folders/rsync/command/rsync_auto.rb +++ b/plugins/synced_folders/rsync/command/rsync_auto.rb @@ -70,6 +70,13 @@ module VagrantPlugins end end + # Exit immediately if there is nothing to watch + if paths.empty? + @logger.warn("No paths to listen for so exiting") + @env.ui.info(I18n.t("vagrant.rsync_auto_no_paths")) + return 1 + end + # Output to the user what paths we'll be watching paths.keys.sort.each do |path| paths[path].each do |path_opts| diff --git a/templates/locales/en.yml b/templates/locales/en.yml index d8727cd5e..a39901ea4 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -156,6 +156,8 @@ en: Running cleanup tasks for '%{name}' provisioner... rsync_auto_initial: |- Doing an initial rsync... + rsync_auto_no_paths: |- + No paths to watch rsync_auto_path: |- Watching: %{path} rsync_communicator_not_ready: |-