mirror of
https://git.sr.ht/~bryan_bennett/flake_env
synced 2025-12-18 07:21:24 +01:00
Filter missing watches before hashing
This commit is contained in:
parent
efa64a4734
commit
8627db86be
4 changed files with 14 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue