chore(docs): report the first stale catalog line
This commit is contained in:
@@ -655,6 +655,16 @@ async function main(): Promise<void> {
|
|||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
console.error(`gen-tool-catalog: ${OUT} is stale. Run \`pnpm run gen-tool-catalog\` and commit ${OUT}.`)
|
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)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user