Compare commits
2 commits
25f237f73a
...
95842b00fd
Author | SHA1 | Date | |
---|---|---|---|
95842b00fd | |||
8f0b197c3e |
4 changed files with 17 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
||||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
||||
|
||||
version: 2
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
||||
version: '3'
|
||||
|
||||
vars:
|
||||
|
|
|
@ -1,16 +1,23 @@
|
|||
package metadata
|
||||
|
||||
import (
|
||||
"os"
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func getVersion() string {
|
||||
content, _ := os.ReadFile("version.txt")
|
||||
version := strings.TrimSpace(string(content))
|
||||
var (
|
||||
GoTomatoVersion = "" // The GoTomato version
|
||||
ProtocolVersion = "" // The protocol version
|
||||
)
|
||||
|
||||
return version
|
||||
func init() {
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
fmt.Printf("%v", info)
|
||||
if !ok {
|
||||
GoTomatoVersion = "unknown"
|
||||
}
|
||||
|
||||
GoTomatoVersion = info.Main.Version
|
||||
ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0]
|
||||
}
|
||||
|
||||
var GoTomatoVersion = getVersion() // The GoTomato version
|
||||
var ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0] // The protocol version
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
devel
|
Loading…
Reference in a new issue