alps/contrib/hotreload.sh

14 lines
337 B
Bash
Raw Normal View History

2020-02-11 16:37:58 +00:00
#!/bin/sh
# Watch themes and plugins files, automatically reload koushin on change.
events=modify,create,delete,move
targets="themes/ plugins/"
inotifywait -e "$events" -m -r $targets | while read line; do
2020-02-11 23:29:51 +00:00
jobs >/dev/null # Reap status of any terminated job
if [ -z "$(jobs)" ]; then
2020-02-11 16:37:58 +00:00
(sleep 0.5 && pkill -USR1 koushin) &
fi
done