nitiwiki: error on --rsync if wiki.rsync_dir is not configured
authorJean Privat <jean@pryen.org>
Thu, 9 Jul 2015 17:16:21 +0000 (13:16 -0400)
committerJean Privat <jean@pryen.org>
Thu, 9 Jul 2015 17:50:08 +0000 (13:50 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

contrib/nitiwiki/src/wiki_base.nit

index 6d7718b..998e47e 100644 (file)
@@ -51,6 +51,10 @@ class Nitiwiki
        fun sync do
                var root = expand_path(config.root_dir, config.out_dir)
                var rsync_dir = config.rsync_dir
+               if rsync_dir == "" then
+                       message("Error: configure `wiki.rsync_dir` to use rsync.", 0)
+                       return
+               end
                sys.system "rsync -vr --delete -- {root.escape_to_sh}/ {rsync_dir.escape_to_sh}"
        end