mirror of
https://github.com/msberends/AMR.git
synced 2025-07-13 05:21:50 +02:00
fix git hooks
This commit is contained in:
@ -33,8 +33,15 @@
|
||||
# This script runs before every commit #
|
||||
########################################
|
||||
|
||||
# check the commit message
|
||||
COMMIT_MSG=$(cat "$1")
|
||||
# try to fetch the commit message from the standard location
|
||||
COMMIT_MSG_PATH=".git/COMMIT_EDITMSG"
|
||||
if [ -f "$COMMIT_MSG_PATH" ]; then
|
||||
COMMIT_MSG=$(cat "$COMMIT_MSG_PATH")
|
||||
else
|
||||
echo "Commit message file not found."
|
||||
echo 1
|
||||
fi
|
||||
# check the commit message, cancel commit if needed
|
||||
if [[ "$COMMIT_MSG" =~ \(no-check\)|\(no-checks\)|\(no-verify\) ]]; then
|
||||
echo "Not running pre-commit checks:"
|
||||
echo "Commit message contains '(no-check)', '(no-checks)', or '(no-verify)."
|
||||
@ -42,7 +49,6 @@ if [[ "$COMMIT_MSG" =~ \(no-check\)|\(no-checks\)|\(no-verify\) ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
echo "Running pre-commit checks..."
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Reference in New Issue
Block a user