feat: add install.sh for one-command hook activation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
pyr0ball 2026-03-07 12:36:18 -08:00
parent db064f3ea5
commit d7e66aa53a

23
install.sh Executable file
View 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