diff --git a/.gitignore b/.gitignore index 1f5a376..d366f2e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ build/build/BAPSicle/ build/output/ +build.py venv/ diff --git a/build/build-linux.sh b/build/build-linux.sh index f238c5e..47970ef 100755 --- a/build/build-linux.sh +++ b/build/build-linux.sh @@ -2,8 +2,7 @@ cd "$(dirname "$0")" build_commit="$(git rev-parse --short HEAD)" -echo "$build_commit" -sed -i "s/BUILD_COMMIT/$build_commit/" ../config.py +echo "BUILD: str = \"$build_commit\"" > ../build.py apt install libportaudio2 diff --git a/build/build-macos.sh b/build/build-macos.sh index bc34f6c..8849623 100755 --- a/build/build-macos.sh +++ b/build/build-macos.sh @@ -2,7 +2,7 @@ cd "$(dirname "$0")" build_commit="$(git rev-parse --short HEAD)" -echo "$build_commit" +echo "BUILD: str = \"$build_commit\"" > ../build.py sed -i '' -e "s/BUILD_COMMIT/$build_commit/" "../config.py" python3 -m venv ../venv diff --git a/build/build-windows.bat b/build/build-windows.bat index dfc08d0..b896369 100644 --- a/build/build-windows.bat +++ b/build/build-windows.bat @@ -1,11 +1,10 @@ cd /D "%~dp0" -: Get the git commit and write it into config.py. +: Get the git commit and write it into build.py. FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --short HEAD`) DO ( SET build_commit=%%F ) - -(Get-Content "..\config.py") -replace 'BUILD_COMMIT', '%build_commit%' | Out-File -encoding ASCII "..\config.py" +echo "BUILD: str = \"%build_commit%\""> ..\build.py py -m venv ..\venv ..\venv\Scripts\activate diff --git a/config.py b/config.py index 4de924d..1b09875 100644 --- a/config.py +++ b/config.py @@ -1,3 +1,2 @@ # BAPSicle Details VERSION: str = "0.1.0" -BUILD: str = "2bc61be" diff --git a/server.py b/server.py index 4f182b8..6410d79 100644 --- a/server.py +++ b/server.py @@ -34,6 +34,9 @@ if not isMacOS(): # Rip, this doesn't like threading on MacOS. import pyttsx3 +if isBundelled(): + import build + import config from typing import Dict, List from helpers.state_manager import StateManager @@ -56,8 +59,8 @@ class BAPSicleServer: default_state = { - "server_version": config.VERSION, - "server_build": config.BUILD, + "server_version": "", + "server_build": "", "server_name": "URY BAPSicle", "host": "localhost", "port": 13500, @@ -512,7 +515,7 @@ def startServer(): # TODO: Check these match, if not, trigger any upgrade noticies / welcome state.update("server_version", config.VERSION) if isBundelled(): - build = config.BUILD + build = build.BUILD else: build = "Dev" state.update("server_build", build)