exec-watch

This commit is contained in:
2026-11-30 17:12:57 +01:00
parent 0f52c02146
commit a430080725
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
set -euo pipefail
script_name=${0##*/}
if (( $# == 0 )); then
echo "Usage: $script_name command [args ...]" >&2
exit 2
fi
if ! command -v inotifywait >/dev/null; then
echo "$script_name: inotifywait was not found. Install inotify-tools." >&2
exit 127
fi
while true; do
("$@") || echo "$script_name: command exited with status $?" >&2
inotifywait --quiet --recursive --event close_write,move,create,delete . >/dev/null
done