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

Function markerBlock

src/sync/git-hooks.ts:124–136  ·  view source on GitHub ↗

The shell snippet (between markers) injected into each hook.

(root: string)

Source from the content-addressed store, hash-verified

122
123/** The shell snippet (between markers) injected into each hook. */
124function markerBlock(root: string): string {
125 return [
126 MARKER_BEGIN,
127 '# Keeps the CodeGraph index fresh while the live file watcher is off',
128 '# (e.g. WSL2 /mnt drives). Runs in the background so it never blocks git.',
129 '# Managed by codegraph; remove with `codegraph uninit` or delete this block.',
130 `${ROOT_PREFIX}${root}`,
131 'if command -v codegraph >/dev/null 2>&1; then',
132 ` ( codegraph sync ${shellQuote(root)} >/dev/null 2>&1 & ) >/dev/null 2>&1`,
133 'fi',
134 MARKER_END,
135 ].join('\n');
136}
137
138type BlockOwner = (blockRoot: string | null) => boolean;
139

Callers 1

installGitSyncHookFunction · 0.85

Calls 2

shellQuoteFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected