# Injects the firmware version from `git describe` (semver tags like v0.1.0). import subprocess Import("env") # noqa: F821 (provided by PlatformIO) try: version = subprocess.check_output( ["git", "describe", "--tags", "--always", "--dirty"], text=True ).strip() except Exception: version = "unknown" env.Append(CPPDEFINES=[("RORO_VERSION", '\\"%s\\"' % version)]) # noqa: F821