Created
August 19, 2016 16:03
-
-
Save shanemhansen/128f5a3ea3acd5cf18c7a8a14261ed68 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 | |
PKG="$1" | |
BIN="$2" | |
shift;shift | |
go install "$BIN" | |
$GOPATH/bin/$(basename $BIN) $@ & | |
while true; do | |
inotifywait -r -e modify -e move -e create "$PKG" | |
if go install -x -n "$BIN" && make build; then | |
kill %1 | |
wait | |
echo "reloading" | |
$GOPATH/bin/$(basename $BIN) $@ & | |
else | |
echo "INFO: project not rebuildable" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment