(tool, check)
| 19981 | return filePath; |
| 19982 | } |
| 19983 | } else { |
| 19984 | if (isUnixExecutable(stats)) { |
| 19985 | return filePath; |
| 19986 | } |
| 19987 | } |
| 19988 | } |
| 19989 | const originalFilePath = filePath; |
| 19990 | for (const extension of extensions) { |
| 19991 | filePath = originalFilePath + extension; |
| 19992 | stats = void 0; |
| 19993 | try { |
| 19994 | stats = yield stat(filePath); |
| 19995 | } catch (err) { |
| 19996 | if (err.code !== "ENOENT") { |
| 19997 | console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); |
| 19998 | } |
| 19999 | } |
| 20000 | if (stats && stats.isFile()) { |
| 20001 | if (IS_WINDOWS) { |
| 20002 | try { |
| 20003 | const directory = path.dirname(filePath); |
| 20004 | const upperName = path.basename(filePath).toUpperCase(); |
| 20005 | for (const actualName of yield readdir(directory)) { |
| 20006 | if (upperName === actualName.toUpperCase()) { |
| 20007 | filePath = path.join(directory, actualName); |
| 20008 | break; |
no test coverage detected