@infinitedusky/indusk-mcp 1.11.5 → 1.11.7
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/dist/bin/commands/update.js +7 -1
- 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) {
|
|
@@ -196,8 +196,14 @@ export async function update(projectRoot) {
|
|
|
196
196
|
for (const file of hookFiles) {
|
|
197
197
|
const sourceFile = join(hooksSource, file);
|
|
198
198
|
const targetFile = join(hooksTarget, file);
|
|
199
|
-
if (!existsSync(sourceFile)
|
|
199
|
+
if (!existsSync(sourceFile))
|
|
200
200
|
continue;
|
|
201
|
+
if (!existsSync(targetFile)) {
|
|
202
|
+
cpSync(sourceFile, targetFile);
|
|
203
|
+
console.info(` added: ${file}`);
|
|
204
|
+
hooksUpdated++;
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
201
207
|
const sourceH = fileHash(sourceFile);
|
|
202
208
|
const targetH = fileHash(targetFile);
|
|
203
209
|
if (sourceH === targetH) {
|