Skip to content

Commit 93dca42

Browse files
committed
fix(security): make gitleaks-missing failure explicit + add Ubuntu apt guidance
When gitleaks is absent the installer now states outright that the pre-commit hook was NOT installed (on stderr) and exits 1, and the Linux guidance gains 'sudo apt install gitleaks' (works on Ubuntu 24.04) alongside the existing releases pointer. Verified by execution: missing gitleaks → exit 1, no hook written; gitleaks present → hook installed and executable.
1 parent 5230c53 commit 93dca42

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

scripts/install-pre-commit-hook.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ REPO_ROOT="$(git rev-parse --show-toplevel)"
77
HOOK="$REPO_ROOT/.git/hooks/pre-commit"
88

99
if ! command -v gitleaks &>/dev/null; then
10-
echo "❌ gitleaks not found on PATH."
11-
echo " macOS: brew install gitleaks"
12-
echo " Linux: https://github.com/gitleaks/gitleaks/releases"
10+
echo "❌ gitleaks not found on PATH — pre-commit hook NOT installed." >&2
11+
echo " Install gitleaks, then re-run this script:" >&2
12+
echo " macOS: brew install gitleaks" >&2
13+
echo " Linux: sudo apt install gitleaks (Ubuntu 24.04+)" >&2
14+
echo " or grab a release: https://github.com/gitleaks/gitleaks/releases" >&2
1315
exit 1
1416
fi
1517

0 commit comments

Comments
 (0)