From bf8c09bd47d2cc412b766513b2744d813349fbda Mon Sep 17 00:00:00 2001 From: Massimiliano Adamo <massimiliano.adamo@geant.org> Date: Fri, 4 Jun 2021 01:08:42 +0200 Subject: [PATCH] add usage instructions --- build.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 5424a71..e806fce 100755 --- a/build.sh +++ b/build.sh @@ -1,11 +1,14 @@ #!/bin/bash # -# for windows and Mac check the README +# you can choose your OS and Architecture as follows: +# ./build.sh --os=windows --arch=amd64 +# +# or you can use --help to check a list of platforms and options # if ! which go &>/dev/null; then echo "Go is not installed or is not in \$PATH" echo "giving up..." - exit + exit 1 fi unset GOBIN BIN_NAME=acme-downloader @@ -86,7 +89,7 @@ if [[ "$OS" == "windows" ]]; then BIN_NAME="${BIN_NAME}.exe" fi -# env GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.appVersion=${PROG_VERSION} -X main.buildTime=${BUILDTIME}" . +# env GOOS=$OS GOARCH=$ARCH go build -ldflags "-s -w -X main.appVersion=${PROG_VERSION} -X main.buildTime=${BUILDTIME}" . env GOOS=$OS GOARCH=$ARCH 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" -- GitLab