Retrieve packaging version number from a temporary Go program

This commit is contained in:
2024-08-05 14:00:49 -04:00
parent 0494143318
commit ffe220fa9b
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -2,4 +2,5 @@
/mutn.exe
/libmuttonserver
/libmuttonserver.exe
/version.go
output
+6 -2
View File
@@ -1,7 +1,11 @@
#!/bin/sh
# get version number from backend TODO embed Go code that reads the value of LibmuttonVersion
version=$(grep 'LibmuttonVersion = "' ../src/backend/1globals.go | cut -c22-26)
# get version number from LibmuttonVersion
cd ..
printf 'package main\nimport (\n"fmt"\n"github.com/rwinkhart/MUTN/src/backend"\n)\nfunc main() {\nfmt.Println(backend.LibmuttonVersion)\n}' > ./version.go
version=$(go run ./version.go)
rm ./version.go
cd ./packaging
# get revision number from user input, fallback to 1 if not provided
if [ -z "$2" ]; then