Skip to content

Commit

Permalink
Fixing issues with contrib/build-release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Shaw committed Mar 14, 2017
1 parent 4e719ff commit 9cbf316
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions contrib/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,35 @@ TAG=v$VER
SRC=$(realpath $(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../)
NAME=$(basename $SRC)

PLAT=$PLATFORM
case $PLAT in
case $PLATFORM in
mingw64)
PLAT=windows
PLATFORM=windows
;;
msys)
PLATFORM=windows
;;
esac

if [ -z "$BUILD" ]; then
BUILD=$SRC/build
if [ "$PLATFORM" == "mingw64" ]; then
if [ "$PLATFORM" == "windows" ]; then
BUILD=$HOME/$NAME
fi
fi

EXT=zip
if [ "$PLATFORM" == "mingw64" ]; then
EXT=tar
if [ "$PLATFORM" == "windows" ]; then
EXT=zip
fi

DIR=$BUILD/$PLATFORM/$VER
BIN=$DIR/$NAME
OUT=$DIR/usql-$VER-$PLAT-amd64.$EXT
OUT=$DIR/usql-$VER-$PLATFORM-amd64.$EXT

rm -rf $DIR
mkdir -p $DIR

if [ "$PLATFORM" == "mingw64" ]; then
if [ "$PLATFORM" == "windows" ]; then
BIN=$BIN.exe
fi

Expand All @@ -54,10 +56,6 @@ set -e

pushd $SRC &> /dev/null

if [ "$PLATFORM" != "mingw64" ]; then
git checkout $TAG
fi

go build -ldflags="-X main.name=$NAME -X main.version=$VER" -o $BIN

if [ "$PLATFORM" == "linux" ]; then
Expand All @@ -78,8 +76,4 @@ case $EXT in
;;
esac

if [ "$PLATFORM" == "mingw64" ]; then
cp $OUT 'f:\'
fi

popd &> /dev/null

0 comments on commit 9cbf316

Please sign in to comment.