@infinitedusky/indusk-mcp 1.11.5 → 1.11.6
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/dist/bin/commands/init.js +10 -12
- package/package.json +1 -1
|
@@ -663,19 +663,17 @@ export async function init(projectRoot, options = {}) {
|
|
|
663
663
|
for (const [event, entries] of Object.entries(hookConfig)) {
|
|
664
664
|
const existingEntries = existing.hooks[event] || [];
|
|
665
665
|
// Check if our hook is already present
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
666
|
+
// Check each hook entry individually so new hooks get added even if old ones exist
|
|
667
|
+
for (const entry of entries) {
|
|
668
|
+
const alreadyPresent = existingEntries.some((e) => e.matcher === entry.matcher &&
|
|
669
|
+
entry.hooks.every((newHook) => e.hooks?.some((h) => h.command === newHook.command)));
|
|
670
|
+
if (!alreadyPresent || force) {
|
|
671
|
+
if (force) {
|
|
672
|
+
existing.hooks[event] = (existing.hooks[event] || []).filter((e) => e.matcher !== entry.matcher);
|
|
673
|
+
}
|
|
674
|
+
existing.hooks[event] = [...(existing.hooks[event] || []), entry];
|
|
675
|
+
hooksUpdated = true;
|
|
676
676
|
}
|
|
677
|
-
existing.hooks[event] = [...(existing.hooks[event] || []), ...entries];
|
|
678
|
-
hooksUpdated = true;
|
|
679
677
|
}
|
|
680
678
|
}
|
|
681
679
|
if (hooksUpdated || permissionsUpdated) {
|