breautek commented on a change in pull request #1130:
URL: https://github.com/apache/cordova-android/pull/1130#discussion_r602715177



##########
File path: bin/templates/cordova/lib/check_reqs.js
##########
@@ -20,29 +20,23 @@
 const execa = require('execa');
 var path = require('path');
 var fs = require('fs-extra');
-var os = require('os');
-var which = require('which');
-const glob = require('fast-glob');
+const { forgivingWhichSync, isWindows, isDarwin } = require('./utils');
+const java = require('./env/java');
 var REPO_ROOT = path.join(__dirname, '..', '..', '..', '..');
 var PROJECT_ROOT = path.join(__dirname, '..', '..');
 const { CordovaError, ConfigParser, events } = require('cordova-common');
 var android_sdk = require('./android_sdk');
 const { createEditor } = require('properties-parser');
+const semver = require('semver');
 
-function forgivingWhichSync (cmd) {
-    const whichResult = which.sync(cmd, { nothrow: true });
-
-    // On null, returns empty string to maintain backwards compatibility
-    // realpathSync follows symlinks
-    return whichResult === null ? '' : fs.realpathSync(whichResult);
-}
+const EXPECTED_JAVA_VERSION = '1.8.x';
 
 module.exports.isWindows = function () {
-    return (os.platform() === 'win32');
+    return isWindows();
 };
 
 module.exports.isDarwin = function () {
-    return (os.platform() === 'darwin');
+    return isDarwin();
 };

Review comment:
       Yes, removing these two functions will require a bigger refactor which 
probably shouldn't be a part of this PR.
   
   I'll add the shorten version with a comment and a TODO




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to