mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 06:33:16 +00:00
Add git commit hash to version.
This commit is contained in:
2
Makefile
2
Makefile
@@ -8,7 +8,7 @@ TMHOME = $${TMHOME:-$$HOME/.tendermint}
|
||||
all: install test
|
||||
|
||||
install: get_vendor_deps
|
||||
@go install ./cmd/tendermint
|
||||
@go install --ldflags '-extldflags "-static"' ./cmd/tendermint
|
||||
|
||||
build:
|
||||
go build --ldflags '-extldflags "-static"' \
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const Maj = "0"
|
||||
const Min = "10"
|
||||
const Fix = "0"
|
||||
|
||||
const Version = Maj + "." + Min + "." + Fix
|
||||
var (
|
||||
// The full version string
|
||||
Version = "0.10.0"
|
||||
|
||||
// GitCommit is set with --ldflags "-X main.gitCommit=$(git rev-parse HEAD)"
|
||||
GitCommit string
|
||||
)
|
||||
|
||||
func init() {
|
||||
Version = fmt.Sprintf("%d.%d.%d", Maj, Min, Fix)
|
||||
|
||||
if GitCommit != "" {
|
||||
Version += "-" + GitCommit[:8]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user