File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ BUILD := `git rev-parse HEAD`
1717TIMESTAMP := ` git log -1 --date=format:%Y%m%d%H%M --pretty=format:%cd `
1818
1919# Use linker flags to provide version/build settings to the target
20- LDFLAGS = -ldflags "-X=github.com/goadapp/goad/version.version=$(VERSION ) -X=github.com/goadapp/goad/version.build=$(BUILD ) "
20+ LDFLAGS = -ldflags "-X=github.com/goadapp/goad/version.version=$(VERSION ) -X=github.com/goadapp/goad/version.build=$(BUILD ) -X=github.com/goadapp/goad/version.travisTag= $( TRAVIS_TAG ) "
2121
2222# go source files, ignore vendor directory
2323SRC = $(shell find . -type f -name '* .go' -not -path "./vendor/* ")
Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ import "strings"
44
55// Version describes the Goad version.
66var (
7- version string
8- build string
7+ version string
8+ build string
9+ travisTag string
910)
1011
1112// Version returns the version
@@ -21,9 +22,16 @@ func Build() string {
2122 return build
2223}
2324
25+ func ReleaseVersion () string {
26+ return travisTag
27+ }
28+
2429// String returns a composed string of version and build number
2530func String () string {
26- return Version () + "-" + Build ()
31+ if ReleaseVersion () == "" {
32+ return Version () + "-" + Build ()
33+ }
34+ return ReleaseVersion ()
2735}
2836
2937// LambdaVersion returns a version string that can be used as a Lambda function
You can’t perform that action at this time.
0 commit comments