Skip to content

Commit

Permalink
Fixes cases where temp dir is null
Browse files Browse the repository at this point in the history
Fixes #86
  • Loading branch information
giggio committed Jan 11, 2017
1 parent a66d829 commit 1c7fb6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions install.js
Expand Up @@ -91,14 +91,14 @@ promise.then(function () {
function findSuitableTempDirectory() {
var now = Date.now();
var candidateTmpDirs = [
process.env.TMPDIR || process.env.npm_config_tmp,
process.env.TMPDIR || process.env.TMP || process.env.npm_config_tmp,
'/tmp',
path.join(process.cwd(), 'tmp')
];

for (var i = 0; i < candidateTmpDirs.length; i++) {
if (!candidateTmpDirs[i]) continue;
var candidatePath = path.join(candidateTmpDirs[i], 'chromedriver');

try {
mkdirp.sync(candidatePath, '0777');
var testFile = path.join(candidatePath, now + '.tmp');
Expand Down

0 comments on commit 1c7fb6f

Please sign in to comment.