Remove unnecessary comments, clean up code

This commit is contained in:
2026-03-03 21:38:32 +01:00
parent cb433f76c9
commit 8e9a3712ac
16 changed files with 197 additions and 331 deletions
+4 -4
View File
@@ -8,7 +8,7 @@ Usage: referenced from platformio.ini as:
"""
import subprocess, os, re
Import("env") # noqa: F821 PlatformIO injects this
Import("env") # noqa: F821 - PlatformIO injects this
def get_git_hash():
try:
@@ -27,14 +27,14 @@ def get_git_hash():
git_hash = get_git_hash()
print(f"[git_hash] short hash = {git_hash}")
# ── Inject into firmware build ────────────────────────────────────────────────
# Inject into firmware build
env.Append(CPPDEFINES=[("GIT_HASH", f'\\"{git_hash}\\"')]) # noqa: F821
# ── Write web/version.js ──────────────────────────────────────────────────────
# Write web/version.js
web_dir = os.path.join(env.subst("$PROJECT_DIR"), "web") # noqa: F821
ver_file = os.path.join(web_dir, "version.js")
os.makedirs(web_dir, exist_ok=True)
with open(ver_file, "w") as f:
f.write(f"// Auto-generated by scripts/git_hash.py do not edit\n")
f.write(f"// Auto-generated by scripts/git_hash.py - do not edit\n")
f.write(f"const FIRMWARE_BUILD_HASH = '{git_hash}';\n")
print(f"[git_hash] wrote {ver_file}")