(thisArg, _arguments, P, generator)
| 19954 | return true; |
| 19955 | }); |
| 19956 | } |
| 19957 | function isRooted(p) { |
| 19958 | p = normalizeSeparators(p); |
| 19959 | if (!p) { |
| 19960 | throw new Error('isRooted() parameter "p" cannot be empty'); |
| 19961 | } |
| 19962 | if (IS_WINDOWS) { |
| 19963 | return p.startsWith("\\") || /^[A-Z]:/i.test(p); |
| 19964 | } |
| 19965 | return p.startsWith("/"); |
| 19966 | } |
| 19967 | function tryGetExecutablePath(filePath, extensions) { |
| 19968 | return __awaiter2(this, void 0, void 0, function* () { |
| 19969 | let stats = void 0; |
| 19970 | try { |
| 19971 | stats = yield stat(filePath); |
| 19972 | } catch (err) { |
| 19973 | if (err.code !== "ENOENT") { |
| 19974 | console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); |
| 19975 | } |
| 19976 | } |
| 19977 | if (stats && stats.isFile()) { |
| 19978 | if (IS_WINDOWS) { |
| 19979 | const upperExt = path.extname(filePath).toUpperCase(); |
| 19980 | if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { |
| 19981 | return filePath; |
| 19982 | } |
| 19983 | } else { |
| 19984 | if (isUnixExecutable(stats)) { |
| 19985 | return filePath; |
no test coverage detected