Created
November 15, 2016 15:46
-
-
Save nimezhu/ef6781af51be79ff88112f766181ff32 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env sh | |
if [ "$#" -eq 1 ]; then | |
fn=$1 | |
else | |
fn="${PWD##*/}" | |
fi | |
if [ ! -d dist ] ; then | |
mkdir dist | |
fi | |
if [ ! -d dist/linux ] ; then | |
mkdir dist/linux | |
fi | |
env GOARCH=amd64 GOOS=linux go build -o dist/linux/$fn | |
if [ ! -d dist/win64 ] ; then | |
mkdir dist/win64 | |
fi | |
env GOARCH=amd64 GOOS=windows go build -o dist/win64/$fn.exe | |
if [ ! -d dist/win32 ] ; then | |
mkdir dist/win32 | |
fi | |
env GOARCH=386 GOOS=windows go build -o dist/win32/$fn.exe | |
if [ ! -d dist/mac ] ; then | |
mkdir dist/mac | |
fi | |
env GOARCH=amd64 GOOS=darwin go build -o dist/mac/$fn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment