feat(scripts): add watch-changes
Based on 2d235c4c71/bin/watch-changes
.
This commit is contained in:
parent
3824c8f40b
commit
7fecbc9343
16
bin/watch-changes
Executable file
16
bin/watch-changes
Executable 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
|
Loading…
Reference in a new issue