Files
pyxis/version.py
torlando-tech 80baf98d52 feat: auto-inject firmware version from git tags at build time
Add version.py PlatformIO pre-build script that reads version from
`git describe --tags --always` and defines FIRMWARE_VERSION as a build
flag. Local builds without tags fall back to "dev". Also rename
FIRMWARE_NAME from "microReticulum" to "Pyxis".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 23:26:09 -05:00

13 lines
311 B
Python

Import("env")
import subprocess
try:
version = subprocess.check_output(
["git", "describe", "--tags", "--always"],
stderr=subprocess.DEVNULL
).decode().strip().lstrip("v")
except Exception:
version = "dev"
env.Append(CPPDEFINES=[("FIRMWARE_VERSION", env.StringifyMacro(version))])