(options, noPrefix)
| 20091 | throw new Error("parameter 'tool' is required"); |
| 20092 | } |
| 20093 | const extensions = []; |
| 20094 | if (IS_WINDOWS && process.env["PATHEXT"]) { |
| 20095 | for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { |
| 20096 | if (extension) { |
| 20097 | extensions.push(extension); |
| 20098 | } |
| 20099 | } |
| 20100 | } |
| 20101 | if (isRooted(tool)) { |
| 20102 | const filePath = yield tryGetExecutablePath(tool, extensions); |
| 20103 | if (filePath) { |
| 20104 | return [filePath]; |
| 20105 | } |
| 20106 | return []; |
| 20107 | } |
| 20108 | if (tool.includes(path2.sep)) { |
| 20109 | return []; |
| 20110 | } |
| 20111 | const directories = []; |
| 20112 | if (process.env.PATH) { |
| 20113 | for (const p of process.env.PATH.split(path2.delimiter)) { |
| 20114 | if (p) { |
| 20115 | directories.push(p); |
| 20116 | } |
| 20117 | } |
| 20118 | } |
| 20119 | const matches = []; |
| 20120 | for (const directory of directories) { |
| 20121 | const filePath = yield tryGetExecutablePath(path2.join(directory, tool), extensions); |
| 20122 | if (filePath) { |
| 20123 | matches.push(filePath); |
| 20124 | } |
no test coverage detected