mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-22 00:31:17 +00:00
fix(wiki): added lang mismatch check before incrementalUpdate call
This commit is contained in:
parent
8fdfd16bd8
commit
4e22babed9
1 changed files with 9 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue