From 5a71bfd5b78ace5898a646ca5a59c464895d0d6e Mon Sep 17 00:00:00 2001 From: Massimiliano Adamo <maxadamo@gmail.com> Date: Tue, 24 Nov 2020 18:56:25 +0100 Subject: [PATCH] ask to run upx --- build.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 5f64b8b..57fbddb 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" -- GitLab