Skip to content

Commit 606625f

Browse files
committed
Fix: Wrong Gradle version is parsed
1 parent 6e6465a commit 606625f

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wavemaker/wm-cordova-cli",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "command line tool to easily build a wavemaker mobile project",
55
"main": "index.js",
66
"preferGlobal": true,

src/requirements.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ const prompt = require('prompt');
99
const VERSIONS = {
1010
'NODE': '10.0.0',
1111
'POD' : '1.9.0',
12-
'JAVA': '1.8.0',
13-
'GRADLE': '6.0.1'
12+
'JAVA': '1.8.0'
1413
}
1514

16-
async function checkAvailability(cmd) {
15+
async function checkAvailability(cmd, transformFn) {
1716
try {
18-
let version = (await exec(cmd, ['--version'])).join('');
19-
17+
let output = (await exec(cmd, ['--version'])).join('');
18+
19+
if (transformFn) {
20+
output = transformFn(output);
21+
}
2022
// to just return version in x.x.x format
21-
version = version.match(/[0-9\.]+/)[0];
23+
const version = output.match(/[0-9]+\.[0-9\.]+/)[0];
2224

2325
logger.info({
2426
'label': loggerLabel,
@@ -58,7 +60,7 @@ module.exports = {
5860
});
5961
},
6062
checkForGradleAvailability: async () => {
61-
return await checkAvailability('gradle');
63+
return await checkAvailability('gradle', o => 0 && o.substrig(o.indexOf('Gradle')) );
6264
},
6365
checkForAndroidStudioAvailability: async () => {
6466
// ANDROID_HOME environment variable is set or not. If it is set checking if its a valid path or no.

0 commit comments

Comments
 (0)