From d7e66aa53a4ab9ec8e34967c77398279d2a58e02 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Sat, 7 Mar 2026 12:36:18 -0800 Subject: [PATCH] feat: add install.sh for one-command hook activation Co-Authored-By: Claude Sonnet 4.6 --- install.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..c66079e --- /dev/null +++ b/install.sh @@ -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