1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-12 12:21:58 +02:00

(v2.1.1.9040) try to put version number in commit msg

This commit is contained in:
2024-06-07 12:07:07 +02:00
parent 0bda9e9997
commit e2acc513a5
4 changed files with 68 additions and 15 deletions

View File

@ -39,7 +39,7 @@ if [ -f "$COMMIT_MSG_PATH" ]; then
COMMIT_MSG=$(cat "$COMMIT_MSG_PATH")
else
echo "Commit message file not found."
COMMIT_MSG=""
exit 1
fi
# check the commit message, cancel commit if needed
if [[ "$COMMIT_MSG" =~ \(no-check\)|\(no-checks\)|\(no-verify\) ]]; then
@ -119,16 +119,8 @@ else
echo "- no NEWS.md found!"
fi
# Prepend the version number to the commit message
if [ -f "$COMMIT_MSG_PATH" ]; then
COMMIT_MSG=$(cat "$COMMIT_MSG_PATH")
echo "Current commit message: $COMMIT_MSG" # Debug line
echo "(v${currentversion}) ${COMMIT_MSG}" > "$COMMIT_MSG_PATH"
echo "- prepended version number to commit message"
echo "Updated commit message: $(cat "$COMMIT_MSG_PATH")" # Debug line
else
echo ""
echo "Commit message file not found. Unable to prepend version number."
fi
# set the version number as an environment variable for the commit-msg hook
export COMMIT_VERSION=$currentversion
echo "- exported COMMIT_VERSION=${currentversion} for the commit-msg hook"
echo ""