From bd9f2bcd2e5a55a41015dca5d5630939bcc70596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Thu, 13 Aug 2026 16:28:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20genScripts=20=E8=8D=89=E7=A8=BF=E5=B9=82?= =?UTF-8?q?=E7=AD=89=E2=80=94=E2=80=94=E5=AD=98=E5=9C=A8=E4=B8=94=E9=9D=9E?= =?UTF-8?q?=20--force=20=E8=B7=B3=E8=BF=87=EF=BC=8C=E9=98=B2=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E4=BA=BA=E5=B7=A5=E7=B2=BE=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/genasset/scripts.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/genasset/scripts.go b/cmd/genasset/scripts.go index e4ab894..a111003 100644 --- a/cmd/genasset/scripts.go +++ b/cmd/genasset/scripts.go @@ -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) {