-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Amir Tocker
committed
Sep 26, 2017
1 parent
93f7374
commit b0fa160
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |