(
args: string[],
cwd: string,
venvPath: string
)
| 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'); |
no test coverage detected