Retrieve packaging version number from a temporary Go program

This commit is contained in:
2024-08-05 14:00:49 -04:00
parent 22117579db
commit 4ef9cb0c80
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -2,4 +2,5 @@
/mutn.exe /mutn.exe
/libmuttonserver /libmuttonserver
/libmuttonserver.exe /libmuttonserver.exe
/version.go
output output
+6 -2
View File
@@ -1,7 +1,11 @@
#!/bin/sh #!/bin/sh
# get version number from backend TODO embed Go code that reads the value of LibmuttonVersion # get version number from LibmuttonVersion
version=$(grep 'LibmuttonVersion = "' ../src/backend/1globals.go | cut -c22-26) 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 # get revision number from user input, fallback to 1 if not provided
if [ -z "$2" ]; then if [ -z "$2" ]; then