Skip to content

Commit

Permalink
Merge pull request #81 from appcelerator/timob-16085_3_2_X
Browse files Browse the repository at this point in the history
[TIMOB-16085] Fixed bug where JAVA_HOME beginning with a tilde was not b...
  • Loading branch information
ayeung committed Mar 24, 2014
2 parents 58ce900 + 9cda0d6 commit 1401da8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/jdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports.detect = function detect(config, opts, finished) {
if (cache && !opts.bypassCache) return finished(cache);

var exe = process.platform == 'win32' ? '.exe' : '',
javaHome = config.get('java.home', process.env.JAVA_HOME && fs.existsSync(process.env.JAVA_HOME) ? process.env.JAVA_HOME : null),
javaHome = config.get('java.home', process.env.JAVA_HOME) || null,
result = cache = {
version: null,
build: null,
Expand All @@ -57,9 +57,11 @@ exports.detect = function detect(config, opts, finished) {
};

// sanity check the java home
javaHome && (javaHome = afs.resolvePath(javaHome));
if (!fs.existsSync(javaHome)) {
javaHome = null;
if (javaHome) {
javaHome = afs.resolvePath(javaHome);
if (!fs.existsSync(javaHome)) {
javaHome = null;
}
}
result.home = javaHome;

Expand Down

0 comments on commit 1401da8

Please sign in to comment.