The shell snippet (between markers) injected into each hook.
()
| 75 | |
| 76 | /** The shell snippet (between markers) injected into each hook. */ |
| 77 | function markerBlock(): string { |
| 78 | return [ |
| 79 | MARKER_BEGIN, |
| 80 | '# Keeps the CodeGraph index fresh while the live file watcher is off', |
| 81 | '# (e.g. WSL2 /mnt drives). Runs in the background so it never blocks git.', |
| 82 | '# Managed by codegraph; remove with `codegraph uninit` or delete this block.', |
| 83 | 'if command -v codegraph >/dev/null 2>&1; then', |
| 84 | ' ( codegraph sync >/dev/null 2>&1 & ) >/dev/null 2>&1', |
| 85 | 'fi', |
| 86 | MARKER_END, |
| 87 | ].join('\n'); |
| 88 | } |
| 89 | |
| 90 | /** Remove our marker block (and the marker lines) from hook content. */ |
| 91 | function stripMarkerBlock(content: string): string { |
no test coverage detected