Skip to content

Commit

Permalink
Merge pull request #80 from appcelerator/timob-16085
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 Jan 18, 2014
2 parents fd33003 + 2ea9530 commit d73bb6b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.2.x
-------------------
* Fixed bug where JAVA_HOME beginning with a tilde was not being resolved to the home directory before checking if the path exists [TIMOB-16085]

0.2.0 (12/18/2013)
-------------------
* Added try/catch around analytics processing with showErrors flag to display errors
Expand Down
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 d73bb6b

Please sign in to comment.