fix: preserve literal dollar signs in stats names

This commit is contained in:
zuyua9 2026-08-13 11:58:33 +08:00
parent 4c54a2e4cd
commit 7b91fe3247
2 changed files with 3 additions and 3 deletions

View file

@ -384,7 +384,7 @@ async function upsertGitNexusSection(
const statsLine = noStats
? `${statsPrefix} **${projectName}**`
: `${statsPrefix} **${projectName}** (${newStatsInner})`;
const updatedSection = existingSection.replace(statsPattern, statsLine);
const updatedSection = existingSection.replace(statsPattern, () => statsLine);
// Count-only delta — leave the committed lean block alone (#2907). A
// project rename, or --no-stats dropping the parenthetical, still writes.
if (stripVolatileCounts(updatedSection) === stripVolatileCounts(existingSection)) {

View file

@ -1511,7 +1511,7 @@ indexed by GitNexus as **OldName** (10 symbols, 20 relationships, 3 execution fl
`;
await fs.writeFile(path.join(dir, 'CLAUDE.md'), original, 'utf-8');
const result = await generateAIContextFiles(dir, storage, 'NewName', {
const result = await generateAIContextFiles(dir, storage, 'Repo$1Name', {
nodes: 55,
edges: 66,
processes: 7,
@ -1519,7 +1519,7 @@ indexed by GitNexus as **OldName** (10 symbols, 20 relationships, 3 execution fl
expect(result.files).toContain('CLAUDE.md (updated)');
expect(await fs.readFile(path.join(dir, 'CLAUDE.md'), 'utf-8')).toContain(
'indexed by GitNexus as **NewName** (55 symbols, 66 relationships, 7 execution flows). Custom.',
'indexed by GitNexus as **Repo$1Name** (55 symbols, 66 relationships, 7 execution flows). Custom.',
);
} finally {
await fs.rm(dir, { recursive: true, force: true });