(repo_root: Path)
| 134 | |
| 135 | |
| 136 | def _hook_script(repo_root: Path) -> str: |
| 137 | repo_root_value = _sh_quote(str(repo_root)) |
| 138 | return ( |
| 139 | "#!/bin/sh\n" |
| 140 | f"{MANAGED_MARKER}: CodeGraphContext auto-update hook\n" |
| 141 | f"CGC_REPO_ROOT={repo_root_value}\n" |
| 142 | "if command -v cgc >/dev/null 2>&1; then\n" |
| 143 | ' cgc update "$CGC_REPO_ROOT" --quiet\n' |
| 144 | "else\n" |
| 145 | ' python -m codegraphcontext update "$CGC_REPO_ROOT" --quiet\n' |
| 146 | "fi\n" |
| 147 | ) |
| 148 | |
| 149 | |
| 150 | def _sh_quote(value: str) -> str: |
no test coverage detected