Compare commits

..

No commits in common. "95842b00fdda5878b6ad17b2c31e294c4b9145a5" and "25f237f73a0b0cb94f3f741a9e862247b213e536" have entirely different histories.

4 changed files with 9 additions and 17 deletions

View file

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

View file

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

View file

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

1
version.txt Normal file
View file

@ -0,0 +1 @@
devel