Skip to content

Commit

Permalink
fix: android error in replace
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed May 3, 2022
1 parent d4bfccc commit 78d7f0a
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.10",
"version": "1.0.11",
"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 @@ -6,6 +6,6 @@ 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('').replace(/\D/g, ''))
const finalContent = newContent.replace(/(.*(?:versionCode[ \t]+).*)/g, ` versionCode "${versionCode}"`)
const finalContent = newContent.replace(/(.*(?:versionCode[ \t]+).*)/g, ` versionCode ${versionCode}`)
return finalContent
}

0 comments on commit 78d7f0a

Please sign in to comment.