MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isSyncHookInstalled

Function isSyncHookInstalled

src/sync/git-hooks.ts:202–212  ·  view source on GitHub ↗
(
  projectRoot: string,
  hooks: GitHookName[] = DEFAULT_SYNC_HOOKS,
)

Source from the content-addressed store, hash-verified

200
201/** Whether any CodeGraph sync hook is currently installed. */
202export function isSyncHookInstalled(
203 projectRoot: string,
204 hooks: GitHookName[] = DEFAULT_SYNC_HOOKS,
205): boolean {
206 const hooksDir = gitHooksDir(projectRoot);
207 if (!hooksDir) return false;
208 return hooks.some((hook) => {
209 const file = path.join(hooksDir, hook);
210 return fs.existsSync(file) && fs.readFileSync(file, 'utf8').includes(MARKER_BEGIN);
211 });
212}

Callers 2

offerWatchFallbackFunction · 0.90
git-hooks.test.tsFile · 0.90

Calls 2

gitHooksDirFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected