mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 00:16:38 +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
@@ -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