Skip to content

Commit

Permalink
fix: Use fs-access shim for file detection.
Browse files Browse the repository at this point in the history
This should solve all issues where `fs.accessSync` is not available.

Closes #53.
  • Loading branch information
dignifiedquire committed Jun 23, 2015
1 parent 4fba727 commit 6355ca8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var fs = require('fs')
var fsAccess = require('fs-access')
var path = require('path')
var which = require('which')

Expand Down Expand Up @@ -56,7 +56,7 @@ function getChromeExe (chromeDirName) {
prefix = prefixes[i]
try {
windowsChromeDirectory = path.join(prefix, suffix)
fs.accessSync(windowsChromeDirectory)
fsAccess.sync(windowsChromeDirectory)
return windowsChromeDirectory
} catch (e) {}
}
Expand Down Expand Up @@ -88,7 +88,7 @@ function getChromeDarwin (defaultPath) {

try {
var homePath = path.join(process.env.HOME, defaultPath)
fs.accessSync(homePath)
fsAccess.sync(homePath)
return homePath
} catch (e) {
return defaultPath
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
],
"author": "Vojta Jina <vojta.jina@gmail.com>",
"dependencies": {
"fs-access": "^1.0.0",
"which": "^1.0.9"
},
"license": "MIT",
Expand Down

0 comments on commit 6355ca8

Please sign in to comment.