From 161696ace5fbd4c59355a61720173430f8dc311e Mon Sep 17 00:00:00 2001
From: Massimiliano Adamo <maxadamo@gmail.com>
Date: Wed, 25 Nov 2020 15:42:06 +0100
Subject: [PATCH] fix build.sh

---
 build.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/build.sh b/build.sh
index bb6999d..c636071 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"
-- 
GitLab