mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-22 04:11:14 +00:00
Make bump version script more portable
This commit is contained in:
parent
949b63f919
commit
88004d55f2
1 changed files with 10 additions and 3 deletions
|
@ -25,7 +25,14 @@ Enter Changelog for $NEW_VERSION_NAME
|
|||
-----------------------------
|
||||
"
|
||||
CHANGELOG=app/src/main/play/release-notes/en-GB/default.txt
|
||||
edit $CHANGELOG
|
||||
if command -v edit >/dev/null; then
|
||||
editor=edit
|
||||
elif [ -n "$EDITOR" ]; then
|
||||
editor="$EDITOR"
|
||||
elif command -v open >/dev/null; then
|
||||
editor=open
|
||||
fi
|
||||
$editor $CHANGELOG
|
||||
|
||||
echo "
|
||||
|
||||
|
@ -34,10 +41,10 @@ Updating Version
|
|||
"
|
||||
OLD_VERSION_CODE=$(grep "versionCode" "app/build.gradle" -m 1 | awk '{print $2}')
|
||||
NEW_VERSION_CODE=$(($OLD_VERSION_CODE + 1))
|
||||
sed -i "s/versionCode $OLD_VERSION_CODE/versionCode $NEW_VERSION_CODE/" "app/build.gradle"
|
||||
sed -i -e "s/versionCode $OLD_VERSION_CODE/versionCode $NEW_VERSION_CODE/" "app/build.gradle"
|
||||
|
||||
OLD_VERSION_NAME=$(grep "versionName" "app/build.gradle" | awk '{print $2}')
|
||||
sed -i "s/$OLD_VERSION_NAME/\"$1\"/" "app/build.gradle"
|
||||
sed -i -e "s/$OLD_VERSION_NAME/\"$1\"/" "app/build.gradle"
|
||||
git add "app/build.gradle" $CHANGELOG
|
||||
git commit -m "Bumped version to $NEW_VERSION_NAME"
|
||||
git tag -a ${NEW_VERSION_NAME} -m "
|
||||
|
|
Loading…
Reference in a new issue