Update scripts

This commit is contained in:
Jafea7 2025-08-29 22:44:32 +10:00
parent 4d00d496ce
commit 4ad94cb258
2 changed files with 20 additions and 11 deletions

View File

@ -1,21 +1,30 @@
#!/bin/bash #!/bin/bash
# Usage: ./update-version.sh 1.2.3 # Usage: ./update-version.sh 25.08.29
NEW_VERSION=$1 INPUT_VERSION=$1
if [[ -z "$NEW_VERSION" ]]; then if [[ -z "$INPUT_VERSION" ]]; then
echo "Usage: $0 <new-version>" echo "Usage: $0 <YY.MM.DD>"
exit 1 exit 1
fi fi
pushd ./master # Convert to Launch4j-safe version
echo "Updating Maven project version to $NEW_VERSION..." IFS='.' read -r YY MM DD <<< "$INPUT_VERSION"
YY=$((10#$YY))
MM=$((10#$MM))
DD=$((10#$DD))
SAFE_VERSION="${YY}.${MM}.${DD}"
echo "Updating Maven project version to $SAFE_VERSION..."
pushd ./master || exit 1
# Step 1: Update the parent POM and all modules # Step 1: Update the parent POM and all modules
mvn versions:set -DnewVersion="$NEW_VERSION" mvn versions:set -DnewVersion="$SAFE_VERSION"
# Step 2: Commit changes # Step 2: Commit changes
mvn versions:commit mvn versions:commit
echo "Version updated to $NEW_VERSION in all modules." echo "Version updated to $SAFE_VERSION in all modules."
popd
popd || exit 1