Skip to content

Commit

Permalink
Fix version bump script to handle semantic versioning format
Browse files Browse the repository at this point in the history
  • Loading branch information
trinhminhtriet committed Nov 25, 2024
1 parent e4b9f0d commit d392df7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/release-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ set -xe

current_version="$(grep '^version = ' Cargo.toml | head -1 | cut -d '"' -f2)"
new_version="$1"
semver="${new_version#v}"

if [ -z "$new_version" ]; then
echo "New version required as argument"
exit 1
fi

echo ">>> Bumping version"
sed -i.bak "s/version = \"$current_version\"/version = \"$new_version\"/" Cargo.toml
sed -i.bak "s/version = \"$current_version\"/version = \"$semver\"/" Cargo.toml
rm Cargo.toml.bak

echo ">>> Running tests"
Expand Down

0 comments on commit d392df7

Please sign in to comment.