X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/7db53a0b3693ddd01e6a36fc5bfb4ba56b4656eb..75585a67831244a20e460b7336d440d4cabe3b41:/src/slave.sml diff --git a/src/slave.sml b/src/slave.sml index b0148f1..719b417 100644 --- a/src/slave.sml +++ b/src/slave.sml @@ -56,7 +56,12 @@ fun registerPostHandler handler = end fun handleChanges fs = (!preHandler (); - app (!fileHandler) fs; + app (fn recd as {action, file, ...} => + (!fileHandler recd; + if action = Delete andalso Posix.FileSys.access (file, []) then + OS.FileSys.remove file + else + ())) fs; !postHandler ()) fun shell ss = OS.Process.isSuccess (OS.Process.system (String.concat ss))