MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / findOnPath

Function findOnPath

scripts/gclient-sync.ts:46–63  ·  view source on GitHub ↗
(
  command: string,
  env: NodeJS.ProcessEnv,
)

Source from the content-addressed store, hash-verified

44}
45
46function findOnPath(
47 command: string,
48 env: NodeJS.ProcessEnv,
49): string | undefined {
50 const names = isWindows ? [`${command}.bat`, `${command}.exe`] : [command];
51 for (const dir of (env[getPathKey(env)] ?? '').split(delimiter)) {
52 if (!dir) {
53 continue;
54 }
55 for (const name of names) {
56 const candidate = join(dir, name);
57 if (existsSync(candidate)) {
58 return candidate;
59 }
60 }
61 }
62 return undefined;
63}
64
65function prependToPath(env: NodeJS.ProcessEnv, dir: string): void {
66 const key = getPathKey(env);

Callers 1

gclient-sync.tsFile · 0.85

Calls 1

getPathKeyFunction · 0.85

Tested by

no test coverage detected