Skip to content

Commit

Permalink
fix: build number android
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed May 3, 2022
1 parent 5dcb248 commit d4bfccc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "capacitor-standard-version",
"version": "1.0.9",
"version": "1.0.10",
"description": "Default standard-version config for capacitor app",
"main": "dist/index.js",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const readVersion = (contents) => {

export const writeVersion = (contents, version) => {
const newContent = contents.replace(/(.*(?:versionName[ \t]+).*)/g, ` versionName "${version}"`)
const versionCode = Number(version.split('.').map(v => v.length === 1 ? `0${v}` : v).join(''))
const versionCode = Number(version.split('.').map(v => v.length === 1 ? `0${v}` : v).join('').replace(/\D/g, ''))
const finalContent = newContent.replace(/(.*(?:versionCode[ \t]+).*)/g, ` versionCode "${versionCode}"`)
return finalContent
}

0 comments on commit d4bfccc

Please sign in to comment.