Skip to content

Commit

Permalink
fix: only use $HOME environmental variable if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
metatoaster authored and dignifiedquire committed Mar 4, 2017
1 parent 9f28aa9 commit 3ffa514
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ var getFirefoxWithFallbackOnOSX = function() {
var homeBin;
for (var i = 0; i < firefoxDirNames.length; i++) {
bin = prefix + firefoxDirNames[i] + suffix;
homeBin = path.join(process.env.HOME, bin);

if (fs.existsSync(homeBin)) {
return homeBin;
if ('HOME' in process.env) {
homeBin = path.join(process.env.HOME, bin);

if (fs.existsSync(homeBin)) {
return homeBin;
}
}

if (fs.existsSync(bin)) {
Expand Down

0 comments on commit 3ffa514

Please sign in to comment.