mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-08-11 00:30:12 -04:00
The daemon had a hardcoded __version__ = "0.2.2b1" that was never bumped, causing the update check to always show an update available. Changed to read APP_VERSION from backend/app/core/config.py at import time so the daemon version stays in sync automatically.
18 lines
524 B
Python
18 lines
524 B
Python
import re
|
|
from pathlib import Path
|
|
|
|
|
|
def _read_app_version() -> str:
|
|
"""Read APP_VERSION from backend config — single source of truth."""
|
|
config_path = Path(__file__).resolve().parent.parent.parent / "backend" / "app" / "core" / "config.py"
|
|
try:
|
|
text = config_path.read_text()
|
|
match = re.search(r'^APP_VERSION\s*=\s*["\'](.+?)["\']', text, re.MULTILINE)
|
|
if match:
|
|
return match.group(1)
|
|
except OSError:
|
|
pass
|
|
return "0.0.0"
|
|
|
|
|
|
__version__ = _read_app_version()
|