X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/c53e82e40cef407de986aa329d31457915ad0dbe..c189cbe97d554b26ec6b203b4ce9f697947ecc38:/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))