(arg)
| 20165 | function isUnixExecutable(stats) { |
| 20166 | return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && process.getgid !== void 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && process.getuid !== void 0 && stats.uid === process.getuid(); |
| 20167 | } |
| 20168 | |
| 20169 | // |
| 20170 | var __awaiter3 = function(thisArg, _arguments, P, generator) { |
| 20171 | function adopt(value) { |
| 20172 | return value instanceof P ? value : new P(function(resolve2) { |
| 20173 | resolve2(value); |
| 20174 | }); |
| 20175 | } |
| 20176 | return new (P || (P = Promise))(function(resolve2, reject) { |
| 20177 | function fulfilled(value) { |
| 20178 | try { |
| 20179 | step(generator.next(value)); |
| 20180 | } catch (e) { |
| 20181 | reject(e); |
| 20182 | } |
| 20183 | } |
| 20184 | function rejected(value) { |
| 20185 | try { |
| 20186 | step(generator["throw"](value)); |
| 20187 | } catch (e) { |
| 20188 | reject(e); |
| 20189 | } |
| 20190 | } |
| 20191 | function step(result) { |
| 20192 | result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); |
| 20193 | } |
| 20194 | step((generator = generator.apply(thisArg, _arguments || [])).next()); |
| 20195 | }); |
| 20196 | }; |
| 20197 | function which(tool, check) { |
| 20198 | return __awaiter3(this, void 0, void 0, function* () { |
| 20199 | if (!tool) { |
| 20200 | throw new Error("parameter 'tool' is required"); |
| 20201 | } |
| 20202 | if (check) { |
| 20203 | const result = yield which(tool, false); |
| 20204 | if (!result) { |
| 20205 | if (IS_WINDOWS) { |
| 20206 | throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); |
| 20207 | } else { |
| 20208 | throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); |
| 20209 | } |
| 20210 | } |
| 20211 | return result; |
| 20212 | } |
| 20213 | const matches = yield findInPath(tool); |
| 20214 | if (matches && matches.length > 0) { |
| 20215 | return matches[0]; |
| 20216 | } |
| 20217 | return ""; |
| 20218 | }); |
| 20219 | } |
| 20220 | function findInPath(tool) { |
| 20221 | return __awaiter3(this, void 0, void 0, function* () { |
| 20222 | if (!tool) { |
| 20223 | throw new Error("parameter 'tool' is required"); |
| 20224 | } |
no test coverage detected