Skip to content

Commit

Permalink
fix: release script
Browse files Browse the repository at this point in the history
  • Loading branch information
npldevfr committed Jan 29, 2024
1 parent d43de90 commit 114ab68
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

# Check if a version number is provided as an argument
if [ $# -eq 0 ]; then
echo "Error: Please provide a version number as an argument."
exit 1
fi

# Get the current version from your composer.json
currentVersion=$(jq -r .version composer.json)

Expand All @@ -20,8 +26,12 @@ incrementVersion() {
fi
}

# Calculate the new version
newVersion=$(incrementVersion "$currentVersion")
# Use the provided version or increment the current version
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
newVersion=$1
else
newVersion=$(incrementVersion "$currentVersion")
fi

# Display the new version
echo "Creating a new release for $(jq -r .name composer.json)..."
Expand Down

0 comments on commit 114ab68

Please sign in to comment.