fix validate

This commit is contained in:
起个名字好难的喵
2025-07-26 22:47:32 +08:00
parent da936c762a
commit c3117c9e36
2 changed files with 10 additions and 2 deletions

View File

@@ -479,7 +479,7 @@ def scan_and_convert(path, target_extensions=None):
# ==================== 验证修复作者信息 ====================
def process_json_authors(input_path, config_path="author_config.json", verbose=False):
def process_json_authors(input_path, verbose=False):
"""
处理 JSON 文件中的作者信息(支持 author → authors 结构化迁移、作者名重命名和链接统一)
@@ -497,6 +497,10 @@ def process_json_authors(input_path, config_path="author_config.json", verbose=F
"errors": []
}
# 获取配置文件路径(和脚本在同一目录)
script_dir = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(script_dir, "author_config.json")
if not os.path.exists(input_path):
raise FileNotFoundError(f"路径不存在:{input_path}")
if not os.path.exists(config_path):