Compare commits
No commits in common. "95842b00fdda5878b6ad17b2c31e294c4b9145a5" and "25f237f73a0b0cb94f3f741a9e862247b213e536" have entirely different histories.
95842b00fd
...
25f237f73a
4 changed files with 9 additions and 17 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
||||
version: '3'
|
||||
|
||||
vars:
|
||||
|
|
|
@ -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
1
version.txt
Normal file
|
@ -0,0 +1 @@
|
|||
devel
|
Loading…
Reference in a new issue