Fix #1234 and extend watch to DELETE event (#1235)

Signed-off-by: Pavel Senchanka <pavel.senchanka@gmail.com>
This commit is contained in:
Pavel Senchanka 2018-09-06 13:47:54 -04:00 committed by Jérémie Dimino
parent 3e23ac7966
commit 7ecd664785
2 changed files with 3 additions and 2 deletions

View File

@ -149,7 +149,7 @@ let watch_command =
| Some inotifywait ->
(* On Linux, use inotifywait. *)
let excludes = String.concat ~sep:"|" excludes in
inotifywait, ["-r"; path; "--exclude"; excludes; "-e"; "close_write"; "-q"]
inotifywait, ["-r"; path; "--exclude"; excludes; "-e"; "close_write"; "-e"; "delete"; "-q"]
| None ->
(* On all other platforms, try to use fswatch. fswatch's event
filtering is not reliable (at least on Linux), so don't try to

View File

@ -685,7 +685,8 @@ end
let cache = Hashtbl.create 32
let clear_cache () =
Hashtbl.reset cache
Hashtbl.reset cache;
Hashtbl.reset Dir_status.cache
let () = Hooks.End_of_build.always clear_cache