2018-03-21 11:56:07 +00:00
|
|
|
#!/bin/bash
|
2021-03-29 05:50:31 +00:00
|
|
|
## Runs build script whenever there is a change in src folder
|
2017-11-06 14:02:51 +00:00
|
|
|
|
|
|
|
echo 'Watching changes on src/'
|
|
|
|
|
2018-03-20 17:14:27 +00:00
|
|
|
current_OS=`uname`
|
|
|
|
|
2021-03-22 03:02:42 +00:00
|
|
|
# For macOS (Darwin), you can install fsevents-tools via Homebrew: `brew install fsevents-tools`
|
2018-03-20 17:14:27 +00:00
|
|
|
if [ $current_OS == "Darwin" ]; then
|
2017-11-06 14:02:51 +00:00
|
|
|
echo
|
2018-03-20 17:14:27 +00:00
|
|
|
notifyloop src ./build.sh
|
|
|
|
else
|
|
|
|
while inotifywait -qqr src -e create,move,modify,delete; do
|
|
|
|
echo
|
|
|
|
echo 'Change detected, running build'
|
|
|
|
./build.sh
|
|
|
|
done
|
|
|
|
fi
|