mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-05 02:43:32 +00:00
fix(wiki): wikimeta stores lang and up-to-date guard throws actionable error instead of silent fails
This commit is contained in:
parent
d31646eaaf
commit
93c7a3b34c
1 changed files with 12 additions and 0 deletions
|
|
@ -74,6 +74,7 @@ export interface WikiMeta {
|
|||
fromCommit: string;
|
||||
generatedAt: string;
|
||||
model: string;
|
||||
lang: string;
|
||||
moduleFiles: Record<string, string[]>;
|
||||
moduleTree: ModuleTreeNode[];
|
||||
}
|
||||
|
|
@ -218,6 +219,15 @@ export class WikiGenerator {
|
|||
|
||||
// Up-to-date check (skip if --force)
|
||||
if (!forceMode && existingMeta && existingMeta.fromCommit === currentCommit) {
|
||||
const currentLang = this.options.lang ?? '';
|
||||
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}.`,
|
||||
);
|
||||
}
|
||||
// Still regenerate the HTML viewer in case it's missing
|
||||
await this.ensureHTMLViewer();
|
||||
return { pagesGenerated: 0, mode: 'up-to-date', failedModules: [] };
|
||||
|
|
@ -379,6 +389,7 @@ export class WikiGenerator {
|
|||
fromCommit: currentCommit,
|
||||
generatedAt: new Date().toISOString(),
|
||||
model: this.llmConfig.model,
|
||||
lang: this.options.lang ?? '',
|
||||
moduleFiles,
|
||||
moduleTree,
|
||||
});
|
||||
|
|
@ -836,6 +847,7 @@ export class WikiGenerator {
|
|||
fromCommit: currentCommit,
|
||||
generatedAt: new Date().toISOString(),
|
||||
model: this.llmConfig.model,
|
||||
lang: this.options.lang ?? '',
|
||||
});
|
||||
|
||||
this.onProgress('done', 100, 'Incremental update complete');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue