1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-26 23:04:49 +03:00
wezterm/ci/update-doc-versions.py

30 lines
799 B
Python
Raw Normal View History

#!/usr/bin/env python3
import glob
import os
import re
import sys
2024-01-29 19:27:03 +03:00
NIGHTLY = '20240128-202157-1e552d76'
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)
SCHEME_DATA = 'docs/colorschemes/data.json'
with open(SCHEME_DATA, 'r') as f:
content = f.read()
with open(SCHEME_DATA, 'w') as f:
content = content.replace("nightly builds only", NIGHTLY)
f.truncate()
f.write(content)