(cmd: string)
| 501 | } |
| 502 | |
| 503 | function normalizeExecutableCommand(cmd: string): string { |
| 504 | const candidate = normalizeExecutableLookup(cmd); |
| 505 | if (!candidate) { |
| 506 | throw new AppError('INVALID_ARGS', `Invalid executable command: ${JSON.stringify(cmd)}`, { |
| 507 | cmd, |
| 508 | hint: 'Use a bare command name from PATH or an absolute executable path.', |
| 509 | }); |
| 510 | } |
| 511 | return candidate; |
| 512 | } |
| 513 | |
| 514 | function createSpawnError(executable: string, cmd: string, args: string[], err: Error): AppError { |
| 515 | const code = (err as NodeJS.ErrnoException).code; |
no test coverage detected