๐Ÿ“ฆ airbnb / lottie-android

๐Ÿ“„ version.sh ยท 20 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#!/bin/bash
git diff-index --quiet HEAD --

if [ $? -ne 0 ]; then
  echo "Working tree must be empty before bumping the version"
fi

sed -i '' "s/    versionName \".*\"/    versionName \"$1\"/" lottie/build.gradle

sed -i '' "s/    versionName \".*\"/    versionName \"$1\"/" LottieSample/build.gradle
versionCode=$((`cat LottieSample/build.gradle | grep versionCode | awk '{print $2}'` + 1))
sed -i '' "s/    versionCode .*/    versionCode $versionCode/" LottieSample/build.gradle

sed -i '' "s/VERSION_NAME=.*/VERSION_NAME=$1/" gradle.properties

git add -A
git commit -m "v$1"
git tag "v$1"
git push --follow-tags
git push origin v$1