Install CGC-managed Git hooks in the nearest repository. The installed hooks run `cgc update --quiet` after commits and checkouts. Existing non-CGC hooks are preserved unless --force is used.
(
path: str = typer.Argument(".", help="Path inside the Git repository"),
force: bool = typer.Option(False, "--force", "-f", help="Replace existing non-CGC hook files"),
)
| 947 | |
| 948 | @hook_app.command("install") |
| 949 | def hook_install( |
| 950 | path: str = typer.Argument(".", help="Path inside the Git repository"), |
| 951 | force: bool = typer.Option(False, "--force", "-f", help="Replace existing non-CGC hook files"), |
| 952 | ): |
| 953 | """ |
| 954 | Install CGC-managed Git hooks in the nearest repository. |
| 955 | |
| 956 | The installed hooks run `cgc update <repo> --quiet` after commits and |
| 957 | checkouts. Existing non-CGC hooks are preserved unless --force is used. |
| 958 | """ |
| 959 | try: |
| 960 | status = install_hooks(path, force=force) |
| 961 | except HookError as exc: |
| 962 | console.print(f"[bold red]Hook install failed:[/bold red] {exc}") |
| 963 | raise typer.Exit(code=1) |
| 964 | |
| 965 | console.print(f"[green]✓[/green] Installed CGC hooks in [bold]{status.repo_root}[/bold]") |
| 966 | console.print(f"[dim]Git directory: {status.git_dir}[/dim]") |
| 967 | |
| 968 | |
| 969 | @hook_app.command("uninstall") |
nothing calls this directly
no test coverage detected