微信小程序页面迁移校验之前 P5任务处理之前
This commit is contained in:
22
scripts/ops/_cleanup_failed.py
Normal file
22
scripts/ops/_cleanup_failed.py
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
"""删除 out/ 中内容以"生成失败"开头的摘要文件,以便重新生成。"""
|
||||
from pathlib import Path
|
||||
|
||||
from _env_paths import ensure_repo_root
|
||||
|
||||
ensure_repo_root()
|
||||
|
||||
OUT = Path("export/session_summaries/out")
|
||||
removed = 0
|
||||
for f in sorted(OUT.glob("*.txt")):
|
||||
try:
|
||||
text = f.read_text(encoding="utf-8")
|
||||
if text.startswith("生成失败"):
|
||||
print(f" 删除: {f.name}")
|
||||
f.unlink()
|
||||
removed += 1
|
||||
except Exception as e:
|
||||
print(f" 读取失败 {f.name}: {e}")
|
||||
|
||||
total = len(list(OUT.glob("*.txt")))
|
||||
print(f"\n删除 {removed} 个失败文件,剩余 {total} 个")
|
||||
Reference in New Issue
Block a user