Skip to content

Instantly share code, notes, and snippets.

@greymd
Created November 27, 2016 10:28
Show Gist options
  • Save greymd/f142b9a94c5d0ce6c4cd1f8d490849a7 to your computer and use it in GitHub Desktop.
Save greymd/f142b9a94c5d0ce6c4cd1f8d490849a7 to your computer and use it in GitHub Desktop.
gradle trigger
#!/bin/bash -xv
# Dependencies
# * fswatch
# $ brew install fswatch
THIS_DIR=$(cd $(dirname $0) && pwd)
SEMAPHORE="/tmp/automake.$$"
while ps $$ > /dev/null ; do
sleep 1
[ -e "$SEMAPHORE" ] || continue
rm -f "$SEMAPHORE"
$THIS_DIR/gradlew build
done &
fswatch --event=Updated $THIS_DIR/src/ | while read $line;
do
touch "$SEMAPHORE"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment