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

Function prependLocalBinsToEnvPath

packages/cli-exec/src/exec.ts:135–145  ·  view source on GitHub ↗

* Adds trusted local bins and the current Node executable directory to PATH.

(
  cwd: string,
  env: NodeJS.ProcessEnv = process.env
)

Source from the content-addressed store, hash-verified

133 * Adds trusted local bins and the current Node executable directory to PATH.
134 */
135async function prependLocalBinsToEnvPath(
136 cwd: string,
137 env: NodeJS.ProcessEnv = process.env
138): Promise<NodeJS.ProcessEnv> {
139 const localPath = await prependLocalBinsToPath(cwd, getEnvPath(env));
140
141 return setEnvPath(
142 env,
143 prependPathEntries(localPath, [path.dirname(process.execPath)])
144 );
145}
146
147/**
148 * Prepends trusted local bin directories to a PATH value.

Callers 1

execResolvedVercelCliFunction · 0.85

Calls 4

getEnvPathFunction · 0.90
setEnvPathFunction · 0.90
prependPathEntriesFunction · 0.90
prependLocalBinsToPathFunction · 0.85

Tested by

no test coverage detected