Clear error message for trying to run all config in a nonexistent directory
authorAdam Chlipala <adamc@hcoop.net>
Thu, 17 May 2007 19:12:40 +0000 (19:12 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Thu, 17 May 2007 19:12:40 +0000 (19:12 +0000)
Makefile
src/main.sml

index 43719ea..c4512ec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -163,7 +163,12 @@ install:
        cp src/plugins/domtool-postgres /usr/local/sbin/
        cp src/plugins/domtool-mysql /usr/local/sbin/
 
-.PHONY: grab_lib
+.PHONY: grab_lib install_server install_slave
 
 grab_lib:
        rsync -r --delete /afs/hcoop.net/common/etc/domtool/lib/* lib/
+
+install_server:
+       sudo /etc/init.d/domtool-server stop
+       sudo make install
+       sudo /etc/init.d/domtool-server start
index 4e377a9..51b8347 100644 (file)
@@ -242,6 +242,14 @@ fun request fname =
 
 fun requestDir dname =
     let
+       val _ = if Posix.FileSys.access (dname, []) then
+                   ()
+               else
+                   (print ("Can't access " ^ dname ^ ".\n");
+                    print "Did you mean to run domtool on a specific file, instead of asking for all\n";
+                    print "files in your ~/domtool directory?\n";
+                    OS.Process.exit OS.Process.failure)
+
        val _ = ErrorMsg.reset ()
 
        val (user, bio) = requestBio (fn () => checkDir dname)