fix: ship external-fix script + lychee JSON save so make external-fix works fresh

scripts/fix_dead_external_links.py was referenced by the Makefile but never
committed, and check_external_links.py did not yet save linkcheck/external.json
(both were working-tree only), so external-fix/external-fix-apply failed on
any fresh clone. The fixer is deliberately conservative: only DNS-failed /
connection-failed / host-unreachable links are auto-commented; .onion links
and ambiguous failures (404/5xx/SSL/refused) go to manual review.
This commit is contained in:
noether
2026-10-12 22:53:09 -06:00
parent f90e694c3e
commit 8e8958274a
2 changed files with 187 additions and 0 deletions
+4
View File
@@ -89,6 +89,10 @@ def main():
for src, line, url, status in sorted(dead):
f.write(f"{src}:{line}\t{url}\t[{status}]\n")
# Save the full lychee JSON so `make external-fix` can act on this run's data
# without re-pinging the web (see scripts/fix_dead_external_links.py).
(outdir / "external.json").write_text(json.dumps(data, indent=2))
print(f"External link check: {total_checked} links checked, {ok} ok, {len(dead)} dead.")
if dead:
print("\nDead external links:")