diff --git a/build.sh b/build.sh index bb6999deefc2c045961893aeb0219b85d26b993a..c636071d1bae22a82b8a230755d162e3ffbe3e79 100755 --- a/build.sh +++ b/build.sh @@ -17,6 +17,11 @@ BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') rm -rf ${GOPATH}/src/github.com/maxadamo/${BIN_NAME} #go get -ldflags "-s -w -X main.appVersion=${PROG_VERSION} -X main.buildTime=${BUILDTIME}" gitlab.geant.net/devops/${BIN_NAME} go get -ldflags "-s -w -X main.appVersion=${PROG_VERSION} -X main.buildTime=${BUILDTIME}" . +if [ $? -gt 0 ]; then + echo -e "\nthere was an error while compiling the code\n" + exit +fi +echo "" while true; do read -p "Do you wish to run upx against ${BIN_NAME}? (y/n) " yn case $yn in @@ -24,14 +29,9 @@ while true; do upx --brute ${GOPATH}/bin/${BIN_NAME} break ;; - [Nn]*) exit ;; + [Nn]*) break ;; *) echo "Please answer yes or no." ;; esac done -if [ $? -gt 0 ]; then - echo -e "\nthere was an error while compiling the code\n" - exit -fi - echo -e "\nthe binary was compiled and it is avilable as:\n - ${GOPATH}/bin/${BIN_NAME}\n"