1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00
wezterm/ci/update-doc-versions.py

22 lines
563 B
Python
Raw Normal View History

#!/usr/bin/env python3
import glob
import os
import re
import sys
2023-03-27 05:45:32 +03:00
NIGHTLY = '20230326-111934-3666303c'
2023-03-27 05:45:32 +03:00
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()
2023-03-27 05:45:32 +03:00
adjusted = SINCE.sub(f"{{{{since('{NIGHTLY}'", content)
if content != adjusted:
print(filename)
with open(filename, "w") as f:
f.truncate()
f.write(adjusted)