-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_hooks.js
More file actions
25 lines (22 loc) · 738 Bytes
/
Copy pathfix_hooks.js
File metadata and controls
25 lines (22 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const fs = require('fs');
const path = 'C:\\Users\\admin\\.gemini\\settings.json';
const config = JSON.parse(fs.readFileSync(path, 'utf8'));
function fixHook(hook) {
if (hook.name === 'claude-mem' && hook.type === 'command' && hook.command.startsWith('"C:\\')) {
if (!hook.command.startsWith('& ')) {
hook.command = '& ' + hook.command;
console.log(`Fixed hook: ${hook.command}`);
}
}
}
if (config.hooks) {
Object.values(config.hooks).forEach(eventHooks => {
eventHooks.forEach(matcherGroup => {
if (matcherGroup.hooks) {
matcherGroup.hooks.forEach(fixHook);
}
});
});
}
fs.writeFileSync(path, JSON.stringify(config, null, 2));
console.log('Successfully updated settings.json');