Skip to content

Commit

Permalink
Make it node 4 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
raphinesse committed Jun 3, 2018
1 parent 7b2f78e commit 3b1bcc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/templates/cordova/lib/check_reqs.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@ module.exports.check_java = function () {
}
}).then(function () {
return Q.denodeify(child_process.exec)('javac -version')
.then(([stdout, stderr]) => {
.then(outputs => {
// outputs contains two entries: stdout and stderr
// Java <= 8 writes version info to stderr, Java >= 9 to stdout
const output = (stdout + stderr).trim();
const output = outputs.join('').trim();
const match = /javac\s+(\d+\.\d+)/i.exec(output);
return match && match[1] === '1.8';
}, () => {
Expand Down

0 comments on commit 3b1bcc9

Please sign in to comment.