1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-29 10:04:49 +03:00
wezterm/ci/update-doc-versions.py
2023-03-26 19:45:32 -07:00

22 lines
563 B
Python
Executable File

#!/usr/bin/env python3
import glob
import os
import re
import sys
NIGHTLY = '20230326-111934-3666303c'
SINCE = re.compile("\{\{since\('nightly'", re.MULTILINE)
for p in ["docs/**/*.md", "docs/**/*.markdown"]:
for filename in glob.glob(p, recursive=True):
with open(filename, "r") as f:
content = f.read()
adjusted = SINCE.sub(f"{{{{since('{NIGHTLY}'", content)
if content != adjusted:
print(filename)
with open(filename, "w") as f:
f.truncate()
f.write(adjusted)