Skip to content

Commit

Permalink
make --version to report the binary version again.
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnaboscoL committed May 5, 2023
1 parent 2a8d6e9 commit 5ee0441
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

if [[ -z "$1" ]]; then
PROGVER="$(git describe --tag)"
PROGVER="$(git describe --tag --always)"
else
PROGVER="$1"
fi
Expand All @@ -10,9 +10,10 @@ CURRENT_DIR=$(pwd)
OUT_DIR=${CURRENT_DIR}/out

PROGNAME="librespeed-cli"
DEFS_PATH="github.com/librespeed/speedtest-cli"
BINARY=${PROGNAME}-$(go env GOOS)-$(go env GOARCH)
BUILD_DATE=$(date -u "+%Y-%m-%d %H:%M:%S %Z")
LDFLAGS="-w -s -X \"librespeed-cli/defs.ProgName=${PROGNAME}\" -X \"librespeed-cli/defs.ProgVersion=${PROGVER}\" -X \"librespeed-cli/defs.BuildDate=${BUILD_DATE}\""
LDFLAGS="-w -s -X \"${DEFS_PATH}/defs.ProgName=${PROGNAME}\" -X \"${DEFS_PATH}/defs.ProgVersion=${PROGVER}\" -X \"${DEFS_PATH}/defs.BuildDate=${BUILD_DATE}\""

if [[ -n "${GOARM}" ]] && [[ "${GOARM}" -gt 0 ]]; then
BINARY=${BINARY}v${GOARM}
Expand Down

0 comments on commit 5ee0441

Please sign in to comment.