feat: add install.sh for one-command hook activation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
db064f3ea5
commit
d7e66aa53a
1 changed files with 23 additions and 0 deletions
23
install.sh
Executable file
23
install.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# install.sh — wire circuitforge-hooks into the calling git repo
|
||||||
|
# Usage: bash /Library/Development/CircuitForge/circuitforge-hooks/install.sh
|
||||||
|
# Usage (quiet): bash /Library/Development/CircuitForge/circuitforge-hooks/install.sh --quiet
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
HOOKS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/hooks" && pwd)"
|
||||||
|
QUIET=false
|
||||||
|
[[ "${1:-}" == "--quiet" ]] && QUIET=true
|
||||||
|
|
||||||
|
if ! git rev-parse --git-dir &>/dev/null; then
|
||||||
|
echo "ERROR: not inside a git repo. Run from your product repo root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
git config core.hooksPath "$HOOKS_DIR"
|
||||||
|
|
||||||
|
if [[ "$QUIET" == "false" ]]; then
|
||||||
|
echo "CircuitForge hooks installed."
|
||||||
|
echo " core.hooksPath → $HOOKS_DIR"
|
||||||
|
echo ""
|
||||||
|
echo "Verify gitleaks is available: gitleaks version"
|
||||||
|
fi
|
||||||
Loading…
Reference in a new issue