diff --git a/build b/build index 10e9c7b6..7e616199 100755 --- a/build +++ b/build @@ -4,6 +4,8 @@ set -ef PKGSRC=${PKGSRC:-github.com/RiV-chain/RiV-mesh/src/version} PKGNAME=${PKGNAME:-$(sh contrib/semver/name.sh)} PKGVER=${PKGVER:-$(sh contrib/semver/version.sh --bare)} +echo "Building: $PKGVER" + if [ "$LDFLAGS" ]; then LDFLAGS="$LDFLAGS -X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER" else diff --git a/contrib/semver/version.sh b/contrib/semver/version.sh index d2ec6ce1..2b61ed22 100644 --- a/contrib/semver/version.sh +++ b/contrib/semver/version.sh @@ -3,9 +3,9 @@ case "$*" in *--bare*) # Remove the "v" prefix - git describe --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" | cut -c 2- + git describe --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" --abbrev=7 | cut -c 2- ;; *) - git describe --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" + git describe --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" --abbrev=7 ;; esac