Skip to content

Commit

Permalink
Complement bumpVersionNumber.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
letwebdev committed Oct 9, 2023
1 parent 50312ea commit bf6043a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build-apk": "npm run sync && npm run build-apk-only",
"fix-path-apk": "sed --in-place 's|/hackernews|.|g' 'android/app/src/main/assets/public/index.html'",
"sync": "npm run build && npm run sync-only",
"build-apk-only": "(cd android && bash ./gradlew assembleDebug)",
"build-apk-only": "(npm run bump && cd android && bash ./gradlew assembleDebug)",
"sync-only": "cap sync && npm run fix-path-apk",
"push": "npm run build && git add -A && git commit && git push",
"bump": "bash ./scripts/bumpVersionNumber.sh"
Expand Down
5 changes: 5 additions & 0 deletions scripts/bumpVersionNumber.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash
# Go to the root dir of the repo
cd "$(git rev-parse --show-toplevel)" || return
allVersionNumbers="$(git tag | grep --extended-regexp 'v[0-9]+.[0-9]+.[0-9]')"
numberOfVersionNumbers="$(echo "${allVersionNumbers}" | wc --lines)"
newVersionNumber="$(
echo "${allVersionNumbers}" | tail --lines 1 |
awk --field-separator=. '/[0-9]+./{$NF++;print}' OFS=.
)"
git tag -a "${newVersionNumber}" -m "Bump version"
sed --in-place --regexp-extended "s/versionCode [0-9]+/versionCode ${numberOfVersionNumbers}/" ./android/app/build.gradle
sed --in-place --regexp-extended "s/versionName \".*\"/versionName \"${newVersionNumber/v/}\"/" ./android/app/build.gradle

0 comments on commit bf6043a

Please sign in to comment.