watchexec/check-hashes.jaq

16 lines
285 B
Text
Raw Normal View History

2023-08-11 11:28:21 +02:00
# vim: ft=jq
def has_changed:
. as $file |
file_hash |
{ prev: kv_fetch($file), cur: (. | kv_store($file)) } |
.prev != .cur
;
if any(.tags[]; .kind == "path") then
any(
.tags[] | select((.kind == "path") and (.filetype == "file"));
.absolute | has_changed
)
else true end