claude-prism 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/installer.mjs +16 -0
- package/package.json +1 -1
package/lib/installer.mjs
CHANGED
|
@@ -232,6 +232,22 @@ export async function update(projectDir) {
|
|
|
232
232
|
if (existsSync(p)) rmSync(p);
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
// Migration: remove legacy individual hook entries from settings.json
|
|
236
|
+
const settingsPath = join(claudeDir, 'settings.json');
|
|
237
|
+
if (existsSync(settingsPath)) {
|
|
238
|
+
const settings = JSON.parse(readFileSync(settingsPath, 'utf8'));
|
|
239
|
+
if (settings.hooks) {
|
|
240
|
+
const legacyCommands = ['commit-guard', 'debug-loop', 'test-tracker', 'scope-guard'];
|
|
241
|
+
for (const [event, hookList] of Object.entries(settings.hooks)) {
|
|
242
|
+
settings.hooks[event] = hookList.filter(
|
|
243
|
+
h => !h.hooks?.some(hh => legacyCommands.some(lc => hh.command?.includes(lc)))
|
|
244
|
+
);
|
|
245
|
+
if (settings.hooks[event].length === 0) delete settings.hooks[event];
|
|
246
|
+
}
|
|
247
|
+
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
235
251
|
// Remove old config so init creates a fresh one
|
|
236
252
|
if (existsSync(configPath)) rmSync(configPath);
|
|
237
253
|
|