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

Method runUvCmd

packages/python/src/uv.ts:243–271  ·  view source on GitHub ↗
(
    args: string[],
    cwd: string,
    venvPath: string
  )

Source from the content-addressed store, hash-verified

241 }
242
243 private async runUvCmd(
244 args: string[],
245 cwd: string,
246 venvPath: string
247 ): Promise<void> {
248 const pretty = `uv ${args.join(' ')}`;
249 debug(`Running "${pretty}"...`);
250
251 try {
252 await execa(this.uvPath, args, {
253 cwd,
254 env: this.getVenvEnv(venvPath),
255 });
256 } catch (err) {
257 const error: Error & { code?: unknown } = new Error(
258 `Failed to run "${pretty}": ${err instanceof Error ? err.message : String(err)}`
259 );
260 // retain code/signal to ensure it's treated as a build error
261 if (err && typeof err === 'object') {
262 if ('code' in err) {
263 error.code = (err as { code: number | string }).code;
264 } else if ('signal' in err) {
265 error.code = (err as { signal: string }).signal;
266 }
267 }
268
269 throw error;
270 }
271 }
272
273 private getVenvEnv(venvPath: string): NodeJS.ProcessEnv {
274 const binDir = isWin ? join(venvPath, 'Scripts') : join(venvPath, 'bin');

Callers 5

syncMethod · 0.95
lockMethod · 0.95
addDependenciesMethod · 0.95
addFromFileMethod · 0.95
pipMethod · 0.95

Calls 4

getVenvEnvMethod · 0.95
debugFunction · 0.90
execaFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected