Created
November 4, 2013 19:30
-
-
Save pandemicsyn/7307914 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| TARGET="$GOPATH/src/github.com/pandemicsyn/$1/*" | |
| INSTALL_ARG="github.com/pandemicsyn/$1" | |
| md5sum_now=`md5 $TARGET` | |
| md5sum_last=`md5 $TARGET` | |
| echo "Attempting build/install of $TARGET" | |
| go tool vet $TARGET | |
| go install $INSTALL_ARG | |
| echo "Monitoring $TARGET for changes.." | |
| while : | |
| do | |
| md5sum_now=`md5 $TARGET` | |
| if [ "$md5sum_last" != "$md5sum_now" ]; then | |
| echo "Rebuilding [`date`]" | |
| go tool vet $TARGET | |
| go install $INSTALL_ARG | |
| echo "" | |
| md5sum_last=`md5 $TARGET` | |
| if [ $? -eq 0 ]; then | |
| sleep 3 | |
| else | |
| sleep 2 | |
| fi | |
| else | |
| sleep 2 | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment