Created
March 5, 2014 17:51
-
-
Save bamboo/9372556 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# adapted from http://stackoverflow.com/questions/4060212/in-linux-how-do-i-run-a-shell-script-when-a-file-or-directory-changes/20381373#20381373 | |
DIRECTORY_TO_OBSERVE="src" | |
BUILD_SCRIPT=./gradlew | |
function block_for_change { | |
inotifywait -r \ | |
-e modify,move,create,delete \ | |
--exclude ".*/build/.*" \ | |
$DIRECTORY_TO_OBSERVE | |
} | |
function build { | |
bash $BUILD_SCRIPT | |
} | |
build | |
while block_for_change; do | |
build | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment