Created
August 2, 2012 23:27
-
-
Save jmoiron/3241916 to your computer and use it in GitHub Desktop.
Run this script in your directory to auto build whenever you modify a golang file
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 | |
cur=`pwd` | |
inotifywait -mqr --timefmt '%d/%m/%y %H:%M' --format '%T %w %f' \ | |
-e modify ./ | while read date time dir file; do | |
ext="${file##*.}" | |
if [[ "$ext" = "go" ]]; then | |
echo "$file changed @ $time $date, rebuilding..." | |
go build | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for this.
I made a fork of your script here. I'm using it mostly for web development. Changes are:
go get
) if some were built during last build$GOPATH
as monitored locations