Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Expand functionality of fileExists function with executable check (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
keremgocen authored and ramya-rao-a committed Jan 8, 2019
1 parent d9f1335 commit 2d44626
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/goPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ function correctBinname(toolName: string) {
}

function fileExists(filePath: string): boolean {
let flag = true;
try {
return fs.statSync(filePath).isFile();
fs.accessSync(filePath, fs.constants.F_OK | fs.constants.X_OK);
} catch (e) {
return false;
flag = false;
}
return flag;
}

export function clearCacheForTools() {
Expand Down

0 comments on commit 2d44626

Please sign in to comment.