feat(scripts): add watch-changes

Based on 2d235c4c71/bin/watch-changes.
This commit is contained in:
Oliver Davies 2023-08-21 23:16:45 +01:00
parent 3824c8f40b
commit 7fecbc9343

16
bin/watch-changes Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
if [[ "$1" == "" || "$2" == "" ]]; then
echo "usage: ${0##*/} <file> <command>";
exit 2;
fi
set -euo pipefail
while true; do
inotifywait \
--event modify \
--event move_self \
--recursive \
$1 && $2
done