fullcourtdefense-cli 1.6.2 → 1.6.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.
|
@@ -123,6 +123,16 @@ async function installCursorHookCommand(args, config) {
|
|
|
123
123
|
});
|
|
124
124
|
const credFile = ensureHomeShield(creds);
|
|
125
125
|
const json = readHooksJson(file);
|
|
126
|
+
// Clear all previous FullCourtDefense-managed hooks first. This prevents old
|
|
127
|
+
// prompt/read/file entries from surviving when the installer narrows the event set.
|
|
128
|
+
for (const key of Object.keys(json.hooks)) {
|
|
129
|
+
const list = Array.isArray(json.hooks[key]) ? json.hooks[key] : [];
|
|
130
|
+
const kept = list.filter((x) => !isManaged(x));
|
|
131
|
+
if (kept.length)
|
|
132
|
+
json.hooks[key] = kept;
|
|
133
|
+
else
|
|
134
|
+
delete json.hooks[key];
|
|
135
|
+
}
|
|
126
136
|
for (const e of events) {
|
|
127
137
|
const { hookKey, flag, failClosedDefault, timeoutSec } = EVENT_MAP[e];
|
|
128
138
|
const failClosed = e === 'prompt' ? false : (args.failClosed !== undefined ? args.failClosed === 'true' : failClosedDefault);
|
|
@@ -133,9 +143,7 @@ async function installCursorHookCommand(args, config) {
|
|
|
133
143
|
if (failClosed)
|
|
134
144
|
entry.failClosed = true;
|
|
135
145
|
const list = Array.isArray(json.hooks[hookKey]) ? json.hooks[hookKey] : [];
|
|
136
|
-
|
|
137
|
-
const preserved = list.filter((x) => !isManaged(x));
|
|
138
|
-
json.hooks[hookKey] = [...preserved, entry];
|
|
146
|
+
json.hooks[hookKey] = [...list, entry];
|
|
139
147
|
}
|
|
140
148
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
141
149
|
fs.writeFileSync(file, JSON.stringify(json, null, 2) + '\n', 'utf8');
|
package/dist/version.json
CHANGED