From 22f7bd801f458fd3a7b2116dba0740d359e31ffa Mon Sep 17 00:00:00 2001 From: Rodrigo de Oliveira Date: Mon, 22 Mar 2021 00:12:18 -0300 Subject: [PATCH] Adds watch for mac os --- build-watch.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/build-watch.sh b/build-watch.sh index 4977df4..b5b6715 100755 --- a/build-watch.sh +++ b/build-watch.sh @@ -1,11 +1,16 @@ #!/bin/sh ## Run the build script whenever there is a change in src folder - echo 'Watching changes on src/' +current_OS=`uname` -while inotifywait -qqr src -e create,move,modify,delete; do - echo - echo 'Change detected, running build' - ./build.sh -done \ No newline at end of file +# For macOS (Darwin), you can install fsevents-tools via Homebrew: `brew install fsevents-tools` +if [ $current_OS == "Darwin" ]; then + 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 \ No newline at end of file