-
-
Save brandonbloom/bc29e8a1d87e47bea78a251d5e06c2af to your computer and use it in GitHub Desktop.
Go: build & run command script
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 | |
set -e | |
if [ "$#" == "0" ]; then | |
echo "Usage: $0 <cmd> <args...>" > /dev/stderr | |
exit 1 | |
fi | |
cmd=$1 | |
shift | |
go build -o bin ./cmd/$cmd/... | |
exec ./bin/$cmd "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment