Skip to content

Commit

Permalink
Improve infotext
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeimers113 committed May 19, 2023
1 parent e579c35 commit 777fc72
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions game/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ import (
var infoText = func() string {
txt := "Strands\n"

// This patch is always the last version + 0.0.1
// Retrieve version number
out, err := exec.Command("git", "describe", "--tags", "--abbrev=0").Output()

if err == nil {
semver := strings.Split(strings.TrimSpace(string(out)), ".")

if len(semver) >= 3 {
major, _ := strconv.Atoi(semver[0])
minor, _ := strconv.Atoi(semver[1])
patch, _ := strconv.Atoi(semver[2])
txt += fmt.Sprintf("Dev patch %d.%d.%d\n", major, minor, patch+1)
txt += fmt.Sprintf("Version %d.%d.%d\n", major, minor, patch)
}
}

Expand Down

0 comments on commit 777fc72

Please sign in to comment.