show build info
This commit is contained in:
parent
f91780d6ce
commit
c964a85673
12
metadata.go
12
metadata.go
@ -95,6 +95,8 @@ func WorkTreeChanged() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GatherMetaData() {
|
func GatherMetaData() {
|
||||||
|
BuildTime = time.Now().Format(time.RFC3339)
|
||||||
|
|
||||||
if !WorkTreeChanged() {
|
if !WorkTreeChanged() {
|
||||||
VersionTag, _ = GetVersionTag()
|
VersionTag, _ = GetVersionTag()
|
||||||
CommitHash, _ = GetCommitHash("%H")
|
CommitHash, _ = GetCommitHash("%H")
|
||||||
@ -103,7 +105,15 @@ func GatherMetaData() {
|
|||||||
VersionTag = fmt.Sprintf("(devel-%s)", hash)
|
VersionTag = fmt.Sprintf("(devel-%s)", hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildTime = time.Now().Format(time.RFC3339)
|
if !*Silent {
|
||||||
|
ColorDone.Println("build info:")
|
||||||
|
fmt.Printf("version: %s\n", VersionTag)
|
||||||
|
fmt.Printf("build time: %s\n", BuildTime)
|
||||||
|
if CommitHash != "" {
|
||||||
|
fmt.Printf("commit hash: %s\n", CommitHash)
|
||||||
|
}
|
||||||
|
fmt.Println()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func BuildLdFlags(os, arch string) string {
|
func BuildLdFlags(os, arch string) string {
|
||||||
|
Loading…
Reference in New Issue
Block a user