Compare commits

..

2 commits

4 changed files with 17 additions and 9 deletions

View file

@ -1,4 +1,5 @@
# vim: set ts=2 sw=2 tw=0 fo=cnqoj # vim: set ts=2 sw=2 tw=0 fo=cnqoj
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
version: 2 version: 2

View file

@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3' version: '3'
vars: vars:

View file

@ -1,16 +1,23 @@
package metadata package metadata
import ( import (
"os" "fmt"
"runtime/debug"
"strings" "strings"
) )
func getVersion() string { var (
content, _ := os.ReadFile("version.txt") GoTomatoVersion = "" // The GoTomato version
version := strings.TrimSpace(string(content)) ProtocolVersion = "" // The protocol version
)
return version func init() {
info, ok := debug.ReadBuildInfo()
fmt.Printf("%v", info)
if !ok {
GoTomatoVersion = "unknown"
} }
var GoTomatoVersion = getVersion() // The GoTomato version GoTomatoVersion = info.Main.Version
var ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0] // The protocol version ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0]
}

View file

@ -1 +0,0 @@
devel