(tool)
| 20004 | }); |
| 20005 | } |
| 20006 | function findInPath(tool) { |
| 20007 | return __awaiter3(this, void 0, void 0, function* () { |
| 20008 | if (!tool) { |
| 20009 | throw new Error("parameter 'tool' is required"); |
| 20010 | } |
| 20011 | const extensions = []; |
| 20012 | if (IS_WINDOWS && process.env["PATHEXT"]) { |
| 20013 | for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { |
| 20014 | if (extension) { |
| 20015 | extensions.push(extension); |
| 20016 | } |
| 20017 | } |
| 20018 | } |
| 20019 | if (isRooted(tool)) { |
| 20020 | const filePath = yield tryGetExecutablePath(tool, extensions); |
| 20021 | if (filePath) { |
| 20022 | return [filePath]; |
| 20023 | } |
| 20024 | return []; |
| 20025 | } |
| 20026 | if (tool.includes(path2.sep)) { |
| 20027 | return []; |
| 20028 | } |
| 20029 | const directories = []; |
| 20030 | if (process.env.PATH) { |
| 20031 | for (const p of process.env.PATH.split(path2.delimiter)) { |
| 20032 | if (p) { |
| 20033 | directories.push(p); |
| 20034 | } |
| 20035 | } |
| 20036 | } |
| 20037 | const matches = []; |
| 20038 | for (const directory of directories) { |
| 20039 | const filePath = yield tryGetExecutablePath(path2.join(directory, tool), extensions); |
| 20040 | if (filePath) { |
| 20041 | matches.push(filePath); |
| 20042 | } |
| 20043 | } |
| 20044 | return matches; |
| 20045 | }); |
| 20046 | } |
| 20047 | |
| 20048 | // |
| 20049 | var import_timers = __require("timers"); |
no test coverage detected