#!/bin/sh
set -eu

repo_root=$(git rev-parse --show-toplevel)
cd "$repo_root"

if command -v python >/dev/null 2>&1; then
    exec python scripts/secret_scan.py --staged
elif command -v py >/dev/null 2>&1; then
    exec py -3.14 scripts/secret_scan.py --staged
else
    echo "SECRET_SCAN_ERROR: Python 3.14 is required for the pre-commit check." >&2
    exit 2
fi
