mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 06:17:27 +00:00
fix(websearch): restore hook recovery and force register
This commit is contained in:
1 parent
ed37a2a513
commit
0821c68559
4 files changed
+61
-3
No files matched your search
@@ -216,7 +216,9 @@ export function registerApiProfileOrphans(options?: {
|
||||
}
|
||||
|
||||
try {
|
||||
ensureProfileHooksOrThrow(orphan.name);
|
||||
if (orphan.validation.valid) {
|
||||
ensureProfileHooksOrThrow(orphan.name);
|
||||
}
|
||||
registerApiProfileInConfig(orphan.name, options?.target || 'claude', options?.force || false);
|
||||
result.registered.push(orphan.name);
|
||||
} catch (error) {
|
||||
|
||||
@@ -25,8 +25,17 @@ function hasMatchingHookContents(sourcePath: string, destinationPath: string): b
|
||||
}
|
||||
|
||||
const source = fs.readFileSync(sourcePath);
|
||||
const destination = fs.readFileSync(destinationPath);
|
||||
return source.equals(destination);
|
||||
try {
|
||||
const destination = fs.readFileSync(destinationPath);
|
||||
return source.equals(destination);
|
||||
} catch (error) {
|
||||
if (process.env.CCS_DEBUG) {
|
||||
console.error(
|
||||
warn(`Existing WebSearch hook is unreadable; reinstalling: ${(error as Error).message}`)
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getTempHookPath(hookPath: string): string {
|
||||
|
||||
Reference in new issue
Block a user