fix(#330): update statusline.js reference during install (#392)

When updating GSD, the installer renames statusline.js to gsd-statusline.js
but didn't update existing settings.json references. Users with the old
config would see their status line disappear.

Now cleanupOrphanedHooks() also checks for and updates any statusLine
config pointing to the old path.

Fixes #330

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
TÂCHES
2026-02-03 09:20:24 -06:00
committed by GitHub
parent ecbc692bc9
commit 074b2bcc20

View File

@@ -716,7 +716,7 @@ function cleanupOrphanedHooks(settings) {
'gsd-intel-prune.js', // Removed in v1.9.2
];
let cleaned = false;
let cleanedHooks = false;
// Check all hook event types (Stop, SessionStart, etc.)
if (settings.hooks) {
@@ -731,7 +731,7 @@ function cleanupOrphanedHooks(settings) {
h.command && orphanedHookPatterns.some(pattern => h.command.includes(pattern))
);
if (hasOrphaned) {
cleaned = true;
cleanedHooks = true;
return false; // Remove this entry
}
}
@@ -742,10 +742,22 @@ function cleanupOrphanedHooks(settings) {
}
}
if (cleaned) {
if (cleanedHooks) {
console.log(` ${green}✓${reset} Removed orphaned hook registrations`);
}
// Fix #330: Update statusLine if it points to old statusline.js path
if (settings.statusLine && settings.statusLine.command &&
settings.statusLine.command.includes('statusline.js') &&
!settings.statusLine.command.includes('gsd-statusline.js')) {
// Replace old path with new path
settings.statusLine.command = settings.statusLine.command.replace(
/statusline\.js/,
'gsd-statusline.js'
);
console.log(` ${green}✓${reset} Updated statusline path (statusline.js → gsd-statusline.js)`);
}
return settings;
}