MCPcopy Create free account
hub / github.com/angular/dev-infra / which

Function which

github-actions/saucelabs/set-saucelabs-env.js:19983–20005  ·  view source on GitHub ↗
(tool, check)

Source from the content-addressed store, hash-verified

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;

Callers 2

execMethod · 0.70

Calls 2

__awaiter3Function · 0.70
findInPathFunction · 0.70

Tested by

no test coverage detected