fix(uninstall): remove gsd-file-manifest.json on uninstall (#1939)

The installer writes gsd-file-manifest.json to the runtime config root
at install time but uninstall() never removed it, leaving stale metadata
after every uninstall. Add fs.rmSync for MANIFEST_NAME at the end of the
uninstall cleanup sequence.

Regression test: tests/bug-1908-uninstall-manifest.test.cjs covers both
global and local uninstall paths.

Closes #1908

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-07 17:19:10 -04:00
committed by GitHub
parent dced50d887
commit 3895178c6a
2 changed files with 142 additions and 0 deletions

View File

@@ -4565,6 +4565,15 @@ function uninstall(isGlobal, runtime = 'claude') {
}
}
// Remove the file manifest that the installer wrote at install time.
// Without this step the metadata file persists after uninstall (#1908).
const manifestPath = path.join(targetDir, MANIFEST_NAME);
if (fs.existsSync(manifestPath)) {
fs.rmSync(manifestPath, { force: true });
removedCount++;
console.log(` ${green}✓${reset} Removed ${MANIFEST_NAME}`);
}
if (removedCount === 0) {
console.log(` ${yellow}⚠${reset} No GSD files found to remove.`);
}