From b5eb4bc3accd24bda22522d9e5403a268ce7d88d Mon Sep 17 00:00:00 2001 From: ssw Date: Thu, 2 Jul 2026 13:52:20 +0800 Subject: [PATCH] =?UTF-8?q?v0.16-1=20=E4=BA=8C=E6=AC=A1=E4=BF=AE=E5=A4=8D:?= =?UTF-8?q?=20report/save+publish=20validateReportCreate=20=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=A4=84=E7=90=86=20(2026-07-02)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit validateReportCreate 返回 {ok, steps: StepValidation[]}, 不是 {ok, errors} 跟之前 v0.15-1 print/update 一样的 bug, 修复遍历 steps 收集错误 --- src/commands/report/publish.ts | 6 ++++-- src/commands/report/save.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/commands/report/publish.ts b/src/commands/report/publish.ts index 376f769..0ad782c 100644 --- a/src/commands/report/publish.ts +++ b/src/commands/report/publish.ts @@ -60,14 +60,16 @@ export function buildReportPublishCommand(): Command { process.exit(1) } - // step machine 校验 + // step machine 校验 (validateReportCreate 返 {ok, steps: StepValidation[]}) const vBasic = validateReportCreate({ fullName: current.fullName as string, enCode: current.enCode as string, category: current.category as string, }) if (!vBasic.ok) { - for (const err of vBasic.errors) log.error(` [${vBasic.stepName}] ${err.message}`) + for (const step of vBasic.steps) { + for (const err of step.errors) log.error(` [${step.stepName}] ${err.message}`) + } process.exit(1) } diff --git a/src/commands/report/save.ts b/src/commands/report/save.ts index bfc9bf9..0c8e71f 100644 --- a/src/commands/report/save.ts +++ b/src/commands/report/save.ts @@ -58,14 +58,16 @@ export function buildReportSaveCommand(): Command { process.exit(1) } - // step machine 校验 + // step machine 校验 (validateReportCreate 返 {ok, steps: StepValidation[]}) const vBasic = validateReportCreate({ fullName: current.fullName as string, enCode: current.enCode as string, category: current.category as string, }) if (!vBasic.ok) { - for (const err of vBasic.errors) log.error(` [${vBasic.stepName}] ${err.message}`) + for (const step of vBasic.steps) { + for (const err of step.errors) log.error(` [${step.stepName}] ${err.message}`) + } process.exit(1) }