From 6eb87afc1ef45c65c8e39c80bb2a29be859be1fb Mon Sep 17 00:00:00 2001 From: Jesse Zhang <13264500190@163.com> Date: Thu, 5 Sep 2024 10:35:45 +0800 Subject: [PATCH] fix: recreate docs folder --- update.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update.py b/update.py index ddeab87..899d0a4 100644 --- a/update.py +++ b/update.py @@ -52,9 +52,9 @@ def generate_md(course: str, filelist_texts: str, readme_path: str): if __name__ == '__main__': - if not os.path.isdir('docs'): - os.mkdir('docs') - + if os.path.exists('docs'): + shutil.rmtree('docs') + os.mkdir('docs') courses = list(filter(lambda x: os.path.isdir(x) and ( x not in EXCLUDE_DIRS), os.listdir('.'))) # list courses @@ -66,4 +66,4 @@ def generate_md(course: str, filelist_texts: str, readme_path: str): mainreadme_lines = file.readlines() with open('docs/index.md', 'w', encoding='utf-8') as file: - file.writelines(mainreadme_lines) \ No newline at end of file + file.writelines(mainreadme_lines)