Skip to content

Commit

Permalink
chore: use the latest tag version and append it with "devel" to signi…
Browse files Browse the repository at this point in the history
…fy the binary installation via source code
  • Loading branch information
CarlJi committed Dec 12, 2023
1 parent 4cf8b5e commit c5ca83d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/gop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func main() {
if len(args) < 1 {
flag.Usage()
}

log.SetFlags(log.Ldefault &^ log.LstdFlags)

base.CmdName = args[0] // for error messages
Expand Down
11 changes: 9 additions & 2 deletions cmd/make.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,18 @@ func getBuildDateTime() string {
}

func getBuildVer() string {
stdout, err := execCommand("git", "describe", "--tags")
latestTagCommit, err := execCommand("git", "rev-list", "--tags", "--max-count=1")
if err != nil {
return ""
}
return trimRight(stdout)

stdout, err := execCommand("git", "describe", "--tags", trimRight(latestTagCommit))
if err != nil {
println(err.Error())
return ""
}

return fmt.Sprintf("%s devel", trimRight(stdout))
}

func getGopBuildFlags() string {
Expand Down

0 comments on commit c5ca83d

Please sign in to comment.