Created
September 15, 2013 14:31
-
-
Save brianknapp/6571242 to your computer and use it in GitHub Desktop.
Go project autoreload on OS X. Replace 'your_go_app' with whatever your app name is You run develop.sh to have it watch the project folder and run rebuild when files change.
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 | |
fswatch ./ ./rebuild.sh |
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 | |
killall your_go_app | |
tput setaf 1 # set color red | |
go install | |
if [[ $? != 0 ]]; then | |
echo 'COMPILE ERROR' | |
else | |
tput setaf 2 # set color green | |
echo 'reloading' | |
gofmt -w *.go | |
PORT=5000 your_go_app & | |
fi | |
tput sgr0 # reset colors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment