| #!/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