feat: move version string to version.txt
- create version.txt to store the version number - add function to read version from version.txt - replace hardcoded version with dynamic retrieval
This commit is contained in:
parent
6e19e43aa7
commit
e9d8d2e2dd
2 changed files with 13 additions and 2 deletions
|
@ -1,6 +1,16 @@
|
|||
package metadata
|
||||
|
||||
import "strings"
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const GoTomatoVersion = "0.1.1" // The GoTomato version
|
||||
func getVersion() string {
|
||||
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
|
||||
|
|
1
version.txt
Normal file
1
version.txt
Normal file
|
@ -0,0 +1 @@
|
|||
devel
|
Loading…
Reference in a new issue