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) }