From 33c4d5a1641ecb09a4191cf1a7082024f6df263d Mon Sep 17 00:00:00 2001 From: Hypatia May Date: Fri, 7 Aug 2026 16:53:58 +0800 Subject: [PATCH] chore(docs): report the first stale catalog line --- scripts/gen-tool-catalog.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/gen-tool-catalog.ts b/scripts/gen-tool-catalog.ts index 50419e416f..b59aafe5f0 100644 --- a/scripts/gen-tool-catalog.ts +++ b/scripts/gen-tool-catalog.ts @@ -655,6 +655,16 @@ async function main(): Promise { process.exit(0) } console.error(`gen-tool-catalog: ${OUT} is stale. Run \`pnpm run gen-tool-catalog\` and commit ${OUT}.`) + const committedLines = committed?.split('\n') ?? [] + const generatedLines = content.split('\n') + const lineCount = Math.max(committedLines.length, generatedLines.length) + for (let index = 0; index < lineCount; index += 1) { + if (committedLines[index] === generatedLines[index]) continue + console.error(`gen-tool-catalog: first difference at line ${index + 1}`) + console.error(` committed: ${JSON.stringify(committedLines[index])}`) + console.error(` generated: ${JSON.stringify(generatedLines[index])}`) + break + } process.exit(1) }