fix(wiki): added lang mismatch check before incrementalUpdate call

This commit is contained in:
sanguine59 2026-05-17 21:43:22 +07:00
parent 8fdfd16bd8
commit 4e22babed9

View file

@ -269,6 +269,15 @@ export class WikiGenerator {
let result: WikiRunResult;
try {
if (!forceMode && existingMeta && existingMeta.fromCommit) {
const currentLang = this.effectiveLang();
const metaLang = existingMeta.lang ?? '';
if (currentLang !== metaLang) {
const prevDisplay = metaLang || 'english (default)';
const nextDisplay = currentLang || 'english (default)';
throw new Error(
`Wiki was generated in ${prevDisplay}; use --force to regenerate in ${nextDisplay}.`,
);
}
result = await this.incrementalUpdate(existingMeta, currentCommit);
} else {
result = await this.fullGeneration(currentCommit);