From 2bd70dd242745f502e4030f8943fedd49b5fdba8 Mon Sep 17 00:00:00 2001 From: John Esmet Date: Mon, 5 Mar 2018 21:44:13 +0000 Subject: [PATCH] Fix release script --- release.bash | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/release.bash b/release.bash index 747f422f..66fa2d71 100755 --- a/release.bash +++ b/release.bash @@ -1,5 +1,7 @@ #!/bin/bash +set -e + if [ -z "$VERSION" ] ; then echo "Must provide VERSION" exit 1 @@ -14,17 +16,15 @@ function release() { export GOOS=$1 export GOARCH=$2 - bin_src_path=ankh/ankh - echo "Building for GOOS=${GOOS} and GOARCH=${GOARCH} using binary from ${bin_src_path}" + echo "Building for GOOS=${GOOS} and GOARCH=${GOARCH}" - bin=ankh-${GOOS}-${GOARCH} - targz=${bin}.tar.gz - rm -f ${release_dir}/${bin} ${release_dir}/${targz} - env GOOS=${GOOS} GOARCH=${GOARCH} make && file ${bin_src_path} && cp ${bin_src_path} ${release_dir}/${bin} && (cd $release_dir && rm -f ankh && cp ${bin} ankh && tar cvfz ${targz} ankh && rm -f ankh) || exit 1 + targz=ankh-${GOOS}-${GOARCH}.tar.gz + rm -f ${release_dir}/ankh ${release_dir}/${targz} + env GOOS=${GOOS} GOARCH=${GOARCH} make + file ankh/ankh && mv -f ankh/ankh ${release_dir}/ankh + (cd $release_dir && tar cvfz ${targz} ankh && ls -lrt && rm -f ankh) || exit 1 } release linux amd64 release darwin amd64 - -make clean