Print message and exit rsync-auto immediately if there is nothing to watch.

This commit is contained in:
Brent Theisen 2014-04-11 16:49:58 -05:00
parent b97c509c15
commit 7b27fa31ce
2 changed files with 9 additions and 0 deletions

View File

@ -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|

View File

@ -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: |-