From b7d2ae0ad07043440c80a67e60b4b88049ea1f81 Mon Sep 17 00:00:00 2001 From: shenweiyan Date: Wed, 18 Oct 2023 11:28:39 +0800 Subject: [PATCH] Update discussions2MkdocsBlog.py v2 --- discussions2MkdocsBlog.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/discussions2MkdocsBlog.py b/discussions2MkdocsBlog.py index 70e2faceac..940411127a 100644 --- a/discussions2MkdocsBlog.py +++ b/discussions2MkdocsBlog.py @@ -87,13 +87,12 @@ def __main__(): gh_owner = gh_repo.split("/")[0] gh_repo_name = gh_repo.split("/")[-1] + # 创建目录; 目录存在则先删除 md outdir = args.outdir if args.outdir else os.getcwd() if os.path.exists(outdir): - # 清除输出目录所有的 md - for file_path in Path(outdir).glob("*.md") + for file_path in Path(outdir).glob("*.md"): file_path.unlink() else: - # 创建输出目录 os.makedirs(outdir) url = "https://api.github.com/graphql"