File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,19 @@ GIT_ALLOW_PUSH_TO_MASTER=false
11
11
# @param $1 version name to update to.
12
12
# @param $2 root directory of project.
13
13
perform_version_bump () {
14
- # Save the version number in a config file called 'example' .
14
+ # Save the version number in an example config file.. .
15
15
echo " $1 " > " $2 /example.cfg"
16
16
17
+ # ...Or perhaps you'd like to edit an iOS Info.plist?
18
+ local currVersion=defaults read " $2 /Info.plist" ' CFBundleVersion'
19
+ defaults write " $2 /Info.plist" ' CFBundleVersion' -string " ${currVersion} "
20
+ defaults write " $2 /Info.plist" ' CFBundleShortVersionString' -string " $1 "
21
+
22
+ # ...Or an Android Gradle config?
23
+ gsed -r ' s/(.*)(versionName )(.*)/echo "\1\2\\"$1\\""/ge' " $2 /build.gradle"
24
+ gsed -r ' s/(.*)(versionCode )([0-9]+)(.*)/echo "\1\2$((\3+1))\4"/ge' " $2 /build.gradle"
25
+
17
26
# Commit the change.
18
- git add " ${config_file } "
27
+ git add " $2 /{example.cfg, Info.plist, build.gradle }"
19
28
git commit -m " :gem: Bump version to $1 " -m " Auto-change using build script v${BUILD_SCRIPT_VERSION} ."
20
29
}
You can’t perform that action at this time.
0 commit comments