fix: auto-trigger hooks at first run

This commit is contained in:
Leon van Kammen 2025-10-24 21:09:41 +02:00
parent 26a3d22882
commit a19c45cea7

View file

@ -83,11 +83,14 @@ start_hook_daemon(){
# 86400 secs = 1 day 3600 = 1 hour
$0 infinite 86400 hook daily &
$0 infinite 3600 hook hourly &
# trigger hooks when files change in /mnt/experiences
# trigger hooks when files change in /mnt
find /mnt -type d -mindepth 1 -maxdepth 1 | while read dir; do
echocolor "[$APPNAME]" "listening to inotify events in $dir"
inotifywait -r -m $dir | awk '$2 ~ /(CREATE|MODIFY|MOVED_TO|DELETE)/ { system("'$0' hook inotify_"$2" "$1""$3) }' &
done
# force-trigger processing hooks in /mnt
find /mnt | grep datapackage | xargs -n1 $0 hook inotify_MODIFY
}