2023-03-21 08:01:24 +03:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import glob
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import sys
|
|
|
|
|
2023-07-12 17:46:13 +03:00
|
|
|
NIGHTLY = '20230712-072601-f4abf8fd'
|
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)
|
2023-04-09 01:01:26 +03:00
|
|
|
|
|
|
|
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)
|