fix: genScripts 草稿幂等——存在且非 --force 跳过,防覆盖人工精修

This commit is contained in:
2026-08-13 16:28:42 +08:00
parent c40d833cd1
commit bd9f2bcd2e
+3
View File
@@ -70,6 +70,9 @@ func genScripts(fl genFlags) {
sem := make(chan struct{}, 2)
var wg sync.WaitGroup
for _, r := range rows {
if !fl.force && fileExists(scriptPath(r["level_id"].Int64(), r["id"].Int64())) {
continue // 幂等:草稿已存在跳过(--force 覆盖;防重跑覆盖人工精修草稿)
}
wg.Add(1)
sem <- struct{}{}
go func(r gdb.Record) {