Skip to content

Commit

Permalink
Make pre-commit hook script POSIX compliant (close #1246)
Browse files Browse the repository at this point in the history
  • Loading branch information
adatzer committed Oct 10, 2023
1 parent de97c3b commit 8f80679
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/git-hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
fi

0 comments on commit 8f80679

Please sign in to comment.