refactor: make README file paths relative to script directory

This commit is contained in:
Jun Siang Cheah (aider) committed 2024-09-01 23:19:27 +01:00
1 parent 8abf2d49aa
commit 1b8491153c
1 file changed
+3 -2
+3 -2
View File
@@ -595,9 +595,10 @@ def main():
print("Missing models:")
print(list(MISSING_MODELS))
with open("README_template.md", "r") as f:
script_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(script_dir, "README_template.md"), "r") as f:
readme = f.read()
with open("../README.md", "w") as f:
with open(os.path.join(script_dir, "..", "README.md"), "w") as f:
f.write(readme.replace("{{MODEL_LIST}}", table).replace("{{TRIAL_MODEL_LIST}}", trial_table))
print("Wrote models to README.md")