#!/usr/bin/env bash
# F∆I Platform — one-time hook activation for this clone.
# Points git at the versioned `.githooks/` directory so pre-commit and
# commit-msg checks run on every commit (including amends and rebases).
#
# Run once after cloning:
#   bash tools/install-hooks.sh
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"

git config core.hooksPath .githooks
chmod +x .githooks/* tools/security/*.sh tools/install-hooks.sh

echo "✓ core.hooksPath = .githooks"
echo "  Active hooks:"
ls -1 .githooks/ | sed 's/^/    /'
echo ""
echo "Next commit will be gated by tools/security/check-staged.sh."
