From 97b381b7480da6626330aec31926c33fa0d290e5 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 28 Mar 2016 15:57:20 +0800 Subject: [PATCH] fix sh error. Signed-off-by: Bo-Yi Wu --- script/build.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/script/build.sh b/script/build.sh index 9d5f8ae..eb82808 100755 --- a/script/build.sh +++ b/script/build.sh @@ -1,10 +1,12 @@ #!/bin/sh -for GOOS in darwin linux windows; do - for GOARCH in 386 amd64; do + +OS="darwin linux windows" +ARCH="amd64" + +for GOOS in $OS; do + for GOARCH in $ARCH; do EXE="gopush" - if [ $GOOS == "windows" ]; then - EXE="gopush.exe" - fi + (test "$GOOS" = "windows") && EXE="gopush.exe" echo "Build: ${GOOS}, Arch: ${GOARCH}, EXE: ${EXE}" GOOS=$GOOS GOARCH=$GOARCH go build -ldflags="-w" -o bin/$GOOS/$GOARCH/${EXE} gopush.go;