update pre-commit increase version logic

This commit is contained in:
bobokun 2023-06-04 15:43:13 -04:00
parent bde5edfec8
commit 3be193636c
No known key found for this signature in database
GPG key ID: B73932169607D927
2 changed files with 9 additions and 1 deletions

View file

@ -1 +1 @@
4.0.0-develop13
4.0.0-develop14

View file

@ -1,5 +1,13 @@
#!/bin/bash
staged_changes=$(git diff-index --cached HEAD | wc -l | awk '{print $1}')
# Check if there are any changes staged for commit
if [ "$staged_changes" -eq 0 ]; then
echo "There are no changes staged for commit. Skipping version update."
exit 0
fi
# Check if the VERSION file is staged for modification
if git diff --cached --name-only | grep -q "VERSION"; then
echo "The VERSION file is already modified. Skipping version update."