Skip to content

Commit 6355ca8

Browse files
fix: Use fs-access shim for file detection.
This should solve all issues where `fs.accessSync` is not available. Closes #53.
1 parent 4fba727 commit 6355ca8

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var fs = require('fs')
1+
var fsAccess = require('fs-access')
22
var path = require('path')
33
var which = require('which')
44

@@ -56,7 +56,7 @@ function getChromeExe (chromeDirName) {
5656
prefix = prefixes[i]
5757
try {
5858
windowsChromeDirectory = path.join(prefix, suffix)
59-
fs.accessSync(windowsChromeDirectory)
59+
fsAccess.sync(windowsChromeDirectory)
6060
return windowsChromeDirectory
6161
} catch (e) {}
6262
}
@@ -88,7 +88,7 @@ function getChromeDarwin (defaultPath) {
8888

8989
try {
9090
var homePath = path.join(process.env.HOME, defaultPath)
91-
fs.accessSync(homePath)
91+
fsAccess.sync(homePath)
9292
return homePath
9393
} catch (e) {
9494
return defaultPath

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"author": "Vojta Jina <[email protected]>",
1919
"dependencies": {
20+
"fs-access": "^1.0.0",
2021
"which": "^1.0.9"
2122
},
2223
"license": "MIT",

0 commit comments

Comments
 (0)