Filter missing watches before hashing

This commit is contained in:
Bryan Bennett 2024-08-17 09:36:21 -04:00
parent efa64a4734
commit 8627db86be
No known key found for this signature in database
GPG key ID: EE149E4215408DE9
4 changed files with 14 additions and 8 deletions

View file

@ -44,7 +44,6 @@ let hash_files = filenames => {
let ctx = Sha1.init();
let files_to_hash =
filenames
|> Array.to_list
|> List.filter(f =>
Sys.file_exists(f)
? true

View file

@ -28,6 +28,13 @@ let get = () => {
};
};
let get_extant = () => {
get()
|> Result.map(watches =>
watches |> Array.to_list |> List.filter(a => a.exists)
);
};
let get_path = doc => {
let pth = doc |> member("path") |> to_string;
String.sub(pth, 11, String.length(pth) - 11);