2023-03-21 08:01:24 +03:00
|
|
|
#!/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-21 08:01:24 +03:00
|
|
|
|
2023-03-27 05:45:32 +03:00
|
|
|
SINCE = re.compile("\{\{since\('nightly'", re.MULTILINE)
|
2023-03-21 08:01:24 +03:00
|
|
|
|
|
|
|
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)
|
2023-03-21 08:01:24 +03:00
|
|
|
if content != adjusted:
|
|
|
|
print(filename)
|
|
|
|
with open(filename, "w") as f:
|
|
|
|
f.truncate()
|
|
|
|
f.write(adjusted)
|