chore: Update readme generator to handle null version

This commit is contained in:
LisoUseInAIKyrios committed 2026-05-11 21:38:25 +02:00
1 parent 27671a31d1
commit 5617e22f05
1 file changed
+10 -5
+10 -5
View File
@@ -105,12 +105,17 @@ def versions_table(targets):
cells = [] cells = []
for t in targets: for t in targets:
ver = t["version"] ver = t["version"]
if ver is None:
continue
label = f"🧪 {ver}" if t.get("isExperimental") else ver label = f"🧪 {ver}" if t.get("isExperimental") else ver
cells.append(label) cells.append(label)
if not cells:
return ""
header = "| " + " | ".join(cells) + " |" header = "| " + " | ".join(cells) + " |"
sep = "| " + " | ".join(":---:" for _ in cells) + " |" sep = "| " + " | ".join(":---:" for _ in cells) + " |"
rows = [header, sep] rows = [header, sep]
# Optional description row — only rendered if at least one target has one # Optional description row — only rendered if at least one target has one
descs = [(t.get("description") or "").replace("\n", "<br>") for t in targets] descs = [(t.get("description") or "").replace("\n", "<br>") for t in targets]
@@ -140,9 +145,9 @@ def spoiler(label, count, targets, tbl, expanded=False):
def build_content(expanded=False): def build_content(expanded=False):
"""Build the full generated patches section.""" """Build the full generated patches section."""
lines = [ lines = [
f"> **[v{ver}](https://github.com/{owner}/{repo}/releases/tag/v{ver})**" f"> **[v{ver}](https://github.com/{owner}/{repo}/releases/tag/v{ver})**"
f"&nbsp;&nbsp;•&nbsp;&nbsp;`{branch}`&nbsp;&nbsp;•&nbsp;&nbsp;" f"&nbsp;&nbsp;•&nbsp;&nbsp;`{branch}`&nbsp;&nbsp;•&nbsp;&nbsp;"
f"{total} patches total" f"{total} patches total"
] ]
# One spoiler per app, in the order they appear in the JSON # One spoiler per app, in the order they appear in the JSON