From 8f80679d7897e770e1c4d0b4aa3c29bcf3c31d38 Mon Sep 17 00:00:00 2001 From: adatzer Date: Tue, 10 Oct 2023 13:00:45 +0300 Subject: [PATCH] Make pre-commit hook script POSIX compliant (close #1246) --- common/git-hooks/pre-commit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/git-hooks/pre-commit b/common/git-hooks/pre-commit index 57df62b1a..07b96ad6c 100644 --- a/common/git-hooks/pre-commit +++ b/common/git-hooks/pre-commit @@ -12,7 +12,7 @@ ERROR_COLOR='\033[0;31m' WARNING_COLOR='\033[0;33m' STOP_COLOR='\033[0m' -if ! command -v gitleaks &> /dev/null +if ! command -v gitleaks > /dev/null 2>&1 then echo "${ERROR_COLOR}\nGitleaks not found. To commit you safely, you need to install it per the instructions at https://github.com/gitleaks/gitleaks.${STOP_COLOR}" exit 1 @@ -21,4 +21,4 @@ then echo "${WARNING_COLOR}\nGitleaks skipped for this commit.${STOP_COLOR}" else gitleaks protect -v --staged --report-path ./findings.json -fi \ No newline at end of file +fi