MCPcopy Create free account
hub / github.com/vercel/vercel / getPathCommandCandidate

Function getPathCommandCandidate

packages/cli-exec/src/lookup.ts:271–281  ·  view source on GitHub ↗

* Builds an absolute candidate path for one PATH entry and command name.

(
  directory: string,
  command: string,
  cwd: string
)

Source from the content-addressed store, hash-verified

269 * Builds an absolute candidate path for one PATH entry and command name.
270 */
271function getPathCommandCandidate(
272 directory: string,
273 command: string,
274 cwd: string
275): string {
276 const candidateDirectory = path.isAbsolute(directory)
277 ? directory
278 : path.resolve(cwd, directory);
279
280 return path.join(candidateDirectory, command);
281}
282
283/**
284 * PATH probing treats absent candidates as normal. Permission failures are only

Callers 1

findCommandInPathFunction · 0.85

Calls 2

resolveMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected