@algocare/react-native-code-push 10.0.0 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli/commands/common.js
CHANGED
|
@@ -39,7 +39,7 @@ async function getIdentifierValue() {
|
|
|
39
39
|
return identifier
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
async function
|
|
42
|
+
async function getBinaryVersionValueFromList(
|
|
43
43
|
getBinaryVersionList,
|
|
44
44
|
app,
|
|
45
45
|
platform,
|
|
@@ -89,9 +89,6 @@ async function getBinaryVersionValue(
|
|
|
89
89
|
if (!semverRegex.test(input)) {
|
|
90
90
|
return 'Please enter a valid version number (x.y.z)'
|
|
91
91
|
}
|
|
92
|
-
if (currentBinaryVersionList.includes(input)) {
|
|
93
|
-
return `Version ${input} already exists`
|
|
94
|
-
}
|
|
95
92
|
return true
|
|
96
93
|
},
|
|
97
94
|
},
|
|
@@ -104,45 +101,7 @@ async function getBinaryVersionValue(
|
|
|
104
101
|
return binaryVersion
|
|
105
102
|
}
|
|
106
103
|
|
|
107
|
-
async function
|
|
108
|
-
getBinaryVersionList,
|
|
109
|
-
app,
|
|
110
|
-
platform,
|
|
111
|
-
identifier
|
|
112
|
-
) {
|
|
113
|
-
const [currentBinaryVersionList, lastBinaryVersion] = await getBinaryVersions(
|
|
114
|
-
getBinaryVersionList,
|
|
115
|
-
app,
|
|
116
|
-
platform,
|
|
117
|
-
identifier
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
const message = lastBinaryVersion
|
|
121
|
-
? `Enter the target binary version (current latest: ${lastBinaryVersion})`
|
|
122
|
-
: 'Enter the target binary version (there is no latest version)'
|
|
123
|
-
|
|
124
|
-
const { binaryVersion } = await inquirer.prompt([
|
|
125
|
-
{
|
|
126
|
-
type: 'input',
|
|
127
|
-
name: 'binaryVersion',
|
|
128
|
-
message,
|
|
129
|
-
validate: (input) => {
|
|
130
|
-
const semverRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/
|
|
131
|
-
if (!semverRegex.test(input)) {
|
|
132
|
-
return 'Please enter a valid version number (x.y.z)'
|
|
133
|
-
}
|
|
134
|
-
if (currentBinaryVersionList.includes(input)) {
|
|
135
|
-
return `Version ${input} already exists`
|
|
136
|
-
}
|
|
137
|
-
return true
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
])
|
|
141
|
-
|
|
142
|
-
return binaryVersion
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
async function getAppVersionValue(
|
|
104
|
+
async function getAppVersionValueFromList(
|
|
146
105
|
getReleaseHistory,
|
|
147
106
|
binaryVersion,
|
|
148
107
|
app,
|
|
@@ -194,9 +153,6 @@ async function getAppVersionValue(
|
|
|
194
153
|
if (!semverRegex.test(input)) {
|
|
195
154
|
return 'Please enter a valid version number (x.y.z)'
|
|
196
155
|
}
|
|
197
|
-
if (currentAppVersionList.includes(input)) {
|
|
198
|
-
return `Version ${input} already exists`
|
|
199
|
-
}
|
|
200
156
|
return true
|
|
201
157
|
},
|
|
202
158
|
},
|
|
@@ -209,7 +165,41 @@ async function getAppVersionValue(
|
|
|
209
165
|
return appVersion
|
|
210
166
|
}
|
|
211
167
|
|
|
212
|
-
async function
|
|
168
|
+
async function getBinaryVersionValueFromInput(
|
|
169
|
+
getBinaryVersionList,
|
|
170
|
+
app,
|
|
171
|
+
platform,
|
|
172
|
+
identifier
|
|
173
|
+
) {
|
|
174
|
+
const [, lastBinaryVersion] = await getBinaryVersions(
|
|
175
|
+
getBinaryVersionList,
|
|
176
|
+
app,
|
|
177
|
+
platform,
|
|
178
|
+
identifier
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
const message = lastBinaryVersion
|
|
182
|
+
? `Enter the target binary version (current latest: ${lastBinaryVersion})`
|
|
183
|
+
: 'Enter the target binary version (there is no latest version)'
|
|
184
|
+
|
|
185
|
+
const { binaryVersion } = await inquirer.prompt([
|
|
186
|
+
{
|
|
187
|
+
type: 'input',
|
|
188
|
+
name: 'binaryVersion',
|
|
189
|
+
message,
|
|
190
|
+
validate: (input) => {
|
|
191
|
+
if (!semverRegex.test(input)) {
|
|
192
|
+
return 'Please enter a valid version number (x.y.z)'
|
|
193
|
+
}
|
|
194
|
+
return true
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
])
|
|
198
|
+
|
|
199
|
+
return binaryVersion
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
async function getAppVersionValueFromInput(
|
|
213
203
|
getReleaseHistory,
|
|
214
204
|
binaryVersion,
|
|
215
205
|
app,
|
|
@@ -252,8 +242,8 @@ module.exports = {
|
|
|
252
242
|
getAppValue,
|
|
253
243
|
getPlatformValue,
|
|
254
244
|
getIdentifierValue,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
245
|
+
getBinaryVersionValueFromList,
|
|
246
|
+
getAppVersionValueFromList,
|
|
247
|
+
getBinaryVersionValueFromInput,
|
|
248
|
+
getAppVersionValueFromInput,
|
|
259
249
|
}
|
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
getAppValue,
|
|
8
8
|
getPlatformValue,
|
|
9
9
|
getIdentifierValue,
|
|
10
|
-
|
|
10
|
+
getBinaryVersionValueFromInput,
|
|
11
11
|
} = require('../common')
|
|
12
12
|
|
|
13
13
|
program
|
|
@@ -27,7 +27,7 @@ program
|
|
|
27
27
|
// identifier
|
|
28
28
|
const identifier = await getIdentifierValue()
|
|
29
29
|
// binaryVersion
|
|
30
|
-
const binaryVersion = await
|
|
30
|
+
const binaryVersion = await getBinaryVersionValueFromInput(
|
|
31
31
|
config.getBinaryVersionList,
|
|
32
32
|
app,
|
|
33
33
|
platform,
|
|
@@ -11,8 +11,8 @@ const {
|
|
|
11
11
|
getAppValue,
|
|
12
12
|
getPlatformValue,
|
|
13
13
|
getIdentifierValue,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
getBinaryVersionValueFromInput,
|
|
15
|
+
getAppVersionValueFromInput,
|
|
16
16
|
} = require('../common')
|
|
17
17
|
|
|
18
18
|
program
|
|
@@ -110,14 +110,14 @@ program
|
|
|
110
110
|
// identifier
|
|
111
111
|
const identifier = await getIdentifierValue()
|
|
112
112
|
// binaryVersion
|
|
113
|
-
const binaryVersion = await
|
|
113
|
+
const binaryVersion = await getBinaryVersionValueFromInput(
|
|
114
114
|
getBinaryVersionList,
|
|
115
115
|
app,
|
|
116
116
|
platform,
|
|
117
117
|
identifier
|
|
118
118
|
)
|
|
119
119
|
// appVersion
|
|
120
|
-
const appVersion = await
|
|
120
|
+
const appVersion = await getAppVersionValueFromInput(
|
|
121
121
|
getReleaseHistory,
|
|
122
122
|
binaryVersion,
|
|
123
123
|
app,
|
|
@@ -5,7 +5,7 @@ const {
|
|
|
5
5
|
getAppValue,
|
|
6
6
|
getPlatformValue,
|
|
7
7
|
getIdentifierValue,
|
|
8
|
-
|
|
8
|
+
getBinaryVersionValueFromList,
|
|
9
9
|
} = require('../common')
|
|
10
10
|
|
|
11
11
|
program
|
|
@@ -27,7 +27,7 @@ program
|
|
|
27
27
|
// identifier
|
|
28
28
|
const identifier = await getIdentifierValue()
|
|
29
29
|
// binaryVersion
|
|
30
|
-
const binaryVersion = await
|
|
30
|
+
const binaryVersion = await getBinaryVersionValueFromList(
|
|
31
31
|
config.getBinaryVersionList,
|
|
32
32
|
app,
|
|
33
33
|
platform,
|
|
@@ -6,8 +6,8 @@ const {
|
|
|
6
6
|
getAppValue,
|
|
7
7
|
getPlatformValue,
|
|
8
8
|
getIdentifierValue,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
getBinaryVersionValueFromList,
|
|
10
|
+
getAppVersionValueFromList,
|
|
11
11
|
} = require('../common')
|
|
12
12
|
|
|
13
13
|
program
|
|
@@ -36,14 +36,14 @@ program
|
|
|
36
36
|
// identifier
|
|
37
37
|
const identifier = await getIdentifierValue()
|
|
38
38
|
// binaryVersion
|
|
39
|
-
const binaryVersion = await
|
|
39
|
+
const binaryVersion = await getBinaryVersionValueFromList(
|
|
40
40
|
config.getBinaryVersionList,
|
|
41
41
|
app,
|
|
42
42
|
platform,
|
|
43
43
|
identifier
|
|
44
44
|
)
|
|
45
45
|
// appVersion
|
|
46
|
-
const appVersion = await
|
|
46
|
+
const appVersion = await getAppVersionValueFromList(
|
|
47
47
|
config.getReleaseHistory,
|
|
48
48
|
binaryVersion,
|
|
49
49
|
app,
|