diff --git a/build.sh b/build.sh index 5f64b8be9f2626ef908537fb3eb32c1b3c06efd0..57fbddbfc2ab4cb5ee0765ffa91ebf9d5547fc7c 100755 --- a/build.sh +++ b/build.sh @@ -17,11 +17,21 @@ 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}" . -# upx --brute ${GOPATH}/bin/${BIN_NAME} +while true; do + read -p "Do you wish to run upx against ${BIN_NAME}?" yn + case $yn in + [Yy]*) + upx --brute ${GOPATH}/bin/${BIN_NAME} + break + ;; + [Nn]*) exit ;; + *) echo "Please answer yes or no." ;; + esac +done if [ $? -gt 0 ]; then - echo -e "\nthere was an error while compiling the code\n" - exit + 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"