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
|
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
||||||
|
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
|
|
|
@ -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]
|
||||||
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
devel
|
|
Loading…
Reference in a new issue