File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ FLAKE_ATTEMPTS ?=5
44PACKAGES ?= api actor command types util version integration/helpers
55LC_ALL = "en_US.UTF-8"
66
7+ CF_BUILD_VERSION ?= $$(git describe --tags --abbrev=0 )
78CF_BUILD_SHA ?= $$(git rev-parse --short HEAD )
89CF_BUILD_DATE ?= $$(date -u +"%Y-%m-%d" )
910LD_FLAGS_COMMON =-w -s \
Original file line number Diff line number Diff line change 11package version
22
3- import "github.com/blang/semver/v4"
3+ import (
4+ "fmt"
5+ "strings"
6+
7+ "github.com/blang/semver/v4"
8+ )
49
510const DefaultVersion = "0.0.0-unknown-version"
611
1116)
1217
1318func VersionString () string {
19+ // Remove the "v" prefix from the binary in case it is present
20+ binaryVersion = strings .TrimPrefix (binaryVersion , "v" )
1421 versionString , err := semver .Make (binaryVersion )
1522 if err != nil {
23+ fmt .Printf ("%s - error: %s\n " , binaryVersion , err )
1624 versionString = semver .MustParse (DefaultVersion )
1725 }
1826
You can’t perform that action at this time.
0 commit comments