Skip to content

Commit d3d9bce

Browse files
committed
Corrected path for Mac OS
1 parent 69e5524 commit d3d9bce

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/Utilities.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,19 @@ export default class Utilities {
3434
return null;
3535
}
3636

37-
try {
38-
var homePath = path.join(process.env.HOME || '', defaultPath);
39-
fs.accessSync(homePath);
40-
return homePath;
41-
} catch (e) {
42-
return null;
37+
var darwinPaths = [
38+
path.join(process.env.HOME || '', defaultPath),
39+
defaultPath,
40+
];
41+
42+
for (let i = 0; i < darwinPaths.length; i++) {
43+
try {
44+
fs.accessSync(darwinPaths[i]);
45+
return darwinPaths[i];
46+
} catch {}
4347
}
48+
49+
return null;
4450
}
4551

4652
// Return location of Edge.exe file for a given directory.

0 commit comments

Comments
 (0)