mirror of
https://git.sr.ht/~bryan_bennett/flake_env
synced 2025-12-16 14:41: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
|
|
@ -6,9 +6,9 @@ let main = () => {
|
|||
| Ok((layout_directory, flake_specifier, other_args)) =>
|
||||
switch (preflight(layout_directory)) {
|
||||
| Ok () =>
|
||||
switch (Lib.Watches.get()) {
|
||||
switch (Lib.Watches.get_extant()) {
|
||||
| Ok(watches) =>
|
||||
let paths = Array.map(watch => watch.path, watches);
|
||||
let paths = List.map(watch => watch.path, watches);
|
||||
let hash =
|
||||
switch (Util.hash_files(paths)) {
|
||||
| Ok(hsh) => hsh
|
||||
|
|
@ -24,8 +24,8 @@ let main = () => {
|
|||
| (true, true) =>
|
||||
let profile_rc_mtime = Unix.stat(profile_rc).st_mtime;
|
||||
let all_older =
|
||||
Array.map(watch => watch.modtime, watches)
|
||||
|> Array.for_all(watch_mtime =>
|
||||
List.map(watch => watch.modtime, watches)
|
||||
|> List.for_all(watch_mtime =>
|
||||
watch_mtime <= int_of_float(profile_rc_mtime)
|
||||
);
|
||||
if (all_older) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue