Adds watch for mac os

This commit is contained in:
Rodrigo de Oliveira 2021-03-22 00:12:18 -03:00
parent 5d9ff5967d
commit 22f7bd801f
1 changed files with 11 additions and 6 deletions

View File

@ -1,11 +1,16 @@
#!/bin/sh #!/bin/sh
## Run the build script whenever there is a change in src folder ## Run the build script whenever there is a change in src folder
echo 'Watching changes on src/' echo 'Watching changes on src/'
current_OS=`uname`
while inotifywait -qqr src -e create,move,modify,delete; do # For macOS (Darwin), you can install fsevents-tools via Homebrew: `brew install fsevents-tools`
echo if [ $current_OS == "Darwin" ]; then
echo 'Change detected, running build' notifyloop src ./build.sh
./build.sh else
done while inotifywait -qqr src -e create,move,modify,delete; do
echo
echo 'Change detected, running build'
./build.sh
done
fi