Skip to content

Commit

Permalink
Add update_version.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Tocker committed Sep 26, 2017
1 parent 93f7374 commit b0fa160
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tools/update_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
new_version=$1

current_version=`grep -oP "(?<=VERSION \= \")([0-9.]+)(?=\")" cloudinary-core/src/main/java/com/cloudinary/Cloudinary.java`
current_version_re=${current_version//./\\.}
echo "Current version is $current_version"
if [ -n "$new_version" ]; then
echo "New version will be $new_version"
echo "Pattern used: $current_version_re"
sed -e "s/${current_version_re}/${new_version}/g" -i "" cloudinary-core/src/main/java/com/cloudinary/Cloudinary.java
sed -e "s/${current_version_re}/${new_version}/g" -i "" README.md
sed -e "s/${current_version_re}/${new_version}/g" -i "" gradle.properties
git changelog -t $new_version
else
echo "Usage: $0 <new version>"
echo "For example: $0 1.9.2"
fi

0 comments on commit b0fa160

Please sign in to comment.