-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.versionrc.js
50 lines (49 loc) · 1.31 KB
/
.versionrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const bumpFiles = [
{
filename: './package.json',
type: 'json',
},
{
filename: './package-lock.json',
type: 'json',
},
{
filename: './android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java',
updater: {
readVersion: (contents) => {
const marketingVersionString = contents.match(/String pluginVersion = "(.*)";/);
const version = marketingVersionString.toString();
return version;
},
writeVersion: (contents, version) => {
const newContent = contents.replace(/String pluginVersion = ".*";/g, `String pluginVersion = "${version}";`);
return newContent;
},
},
},
{
filename: './ios/Plugin/CapacitorUpdater.swift',
updater: {
readVersion: (contents) => {
const marketingVersionString = contents.match(/let pluginVersion = "(.*)"/);
const version = marketingVersionString.toString();
return version;
},
writeVersion: (contents, version) => {
const newContent = contents.replace(/let pluginVersion = ".*"/g, `let pluginVersion = "${version}"`);
return newContent;
},
},
},
];
module.exports = {
noVerify: true,
tagPrefix: '',
bumpFiles: bumpFiles,
packageFiles: [
{
filename: './package.json',
type: 'json',
},
],
};