Compare commits
2 commits
12b01a2757
...
7187ebbdc1
Author | SHA1 | Date | |
---|---|---|---|
7187ebbdc1 | |||
7e7c46dc4c |
3 changed files with 14 additions and 4 deletions
|
@ -28,7 +28,7 @@ func Start() {
|
||||||
|
|
||||||
// show server and protocl version and exit
|
// show server and protocl version and exit
|
||||||
if *showVersionFlag {
|
if *showVersionFlag {
|
||||||
fmt.Println("Server-Version:", metadata.GoTomatoVersion)
|
fmt.Println("GoTomato", metadata.GoTomatoVersion)
|
||||||
fmt.Println("Protocol-Version:", metadata.ProtocolVersion)
|
fmt.Println("Protocol-Version:", metadata.ProtocolVersion)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
package metadata
|
package metadata
|
||||||
|
|
||||||
import "strings"
|
import (
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
// This will be overwritten by goreleaser on build
|
func getVersion() string {
|
||||||
var GoTomatoVersion = "devel" // The GoTomato version
|
content, _ := os.ReadFile("version.txt")
|
||||||
|
version := strings.TrimSpace(string(content))
|
||||||
|
|
||||||
|
return version
|
||||||
|
}
|
||||||
|
|
||||||
|
var GoTomatoVersion = getVersion() // The GoTomato version
|
||||||
var ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0] // The protocol 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