Somewhat better version handling

This commit is contained in:
Imbus 2025-01-28 11:40:56 +01:00
parent e7596e41f7
commit f5de8d1f37
5 changed files with 19 additions and 12 deletions

View file

@ -1,7 +1,10 @@
NAME = rexserver
VERSION_FILE := ../VERSION.txt
REX_VERSION ?= $(shell cat $(VERSION_FILE))
build: commit.txt
go build -o $(NAME)
go build -ldflags="-X main.rex_version=$(REX_VERSION)" -o $(NAME)
run: commit.txt
go run .

View file

@ -7,11 +7,15 @@ import (
"net/http"
"rex_model"
"time"
"strings"
)
var rex_version = "UNDEFINED"
func main() {
port := ":8080"
addons := rex_model.AddonIndex
log.Printf("Starting RexForge server version: %s", strings.ToUpper(rex_version))
mux := http.NewServeMux()