* Resolves one CLI invocation and executes it once.
( args: string[], options: ExecVercelCliOptions, cwd: string, env: NodeJS.ProcessEnv, pathValue: string )
| 62 | * Resolves one CLI invocation and executes it once. |
| 63 | */ |
| 64 | async function execResolvedVercelCli( |
| 65 | args: string[], |
| 66 | options: ExecVercelCliOptions, |
| 67 | cwd: string, |
| 68 | env: NodeJS.ProcessEnv, |
| 69 | pathValue: string |
| 70 | ): Promise<ExecVercelCliResult> { |
| 71 | const invocation = await resolveInvocationOrThrow(cwd, pathValue); |
| 72 | |
| 73 | try { |
| 74 | const execaOptions: ExecaOptions = { |
| 75 | input: options.input, |
| 76 | stdio: options.stdio, |
| 77 | stdin: options.stdin, |
| 78 | stdout: options.stdout, |
| 79 | stderr: options.stderr, |
| 80 | timeout: options.timeout, |
| 81 | cwd, |
| 82 | env: await prependLocalBinsToEnvPath(cwd, env), |
| 83 | windowsHide: true, |
| 84 | }; |
| 85 | |
| 86 | if (options.signal) { |
| 87 | execaOptions.signal = options.signal; |
| 88 | } |
| 89 | |
| 90 | const { stdout, stderr } = await execa( |
| 91 | invocation.command, |
| 92 | [...invocation.commandArgs, ...args], |
| 93 | execaOptions |
| 94 | ); |
| 95 | |
| 96 | return { stdout, stderr, invocation }; |
| 97 | } catch (error) { |
| 98 | throw toVercelCliError(invocation, error); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Resolves the cached CLI invocation or throws with resolution diagnostics. |
no test coverage detected