cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [50/50] [abbrv] git commit: CB-5422: Don't require JAVA_HOME to be defined
Date Wed, 22 Jan 2014 19:39:01 GMT
CB-5422: Don't require JAVA_HOME to be defined

JAVA_HOME is not necessarily defined on Linux and Mac.
Print out the value of JAVA_HOME in the error message
in case "java -version" fails.


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/17d373a5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/17d373a5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/17d373a5

Branch: refs/heads/master
Commit: 17d373a5af9785c6ab409db2930a6fd1654e63b0
Parents: 5bc99c0
Author: Mark Koudritsky <kamrik@chromium.org>
Authored: Wed Nov 27 16:59:20 2013 -0500
Committer: Joe Bowser <bowserj@apache.org>
Committed: Wed Jan 22 11:37:24 2014 -0800

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/17d373a5/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 807086e..ef11e0c 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -52,16 +52,18 @@ module.exports.check_ant = function() {
 
 // Returns a promise.
 module.exports.check_java = function() {
-    if(process.env.JAVA_HOME) {
-        var d = Q.defer();
-        child_process.exec('java', function(err, stdout, stderr) {
-            if(err) d.reject(new Error('ERROR : executing command \'java\', make sure you
java environment is set up. Including your JDK and JRE.'));
-            else d.resolve();
-        });
-        return d.promise;
-    } else {
-        return Q.reject(new Error('ERROR : Make sure JAVA_HOME is set, as well as paths to
your JDK and JRE for java.'));
-    }
+    var d = Q.defer();
+    child_process.exec('java -version', function(err, stdout, stderr) {
+        if(err) {
+            var msg =
+                'Failed to run \'java -version\', make sure your java environment is set
up\n' +
+                'including JDK and JRE.\n' +
+                'Your JAVA_HOME variable is ' + process.env.JAVA_HOME + '\n';
+            d.reject(new Error(msg + err));
+        }
+        else d.resolve();
+    });
+    return d.promise;
 }
 
 // Returns a promise.


Mime
View raw message