( rawPath: string | undefined, envName: string, kind: 'executable' | 'file', )
| 627 | } |
| 628 | |
| 629 | function normalizeOverridePath( |
| 630 | rawPath: string | undefined, |
| 631 | envName: string, |
| 632 | kind: 'executable' | 'file', |
| 633 | ): string | undefined { |
| 634 | const candidate = rawPath?.trim(); |
| 635 | if (!candidate) return undefined; |
| 636 | if (!path.isAbsolute(candidate) || candidate.includes('\0')) { |
| 637 | throw new AppError( |
| 638 | 'INVALID_ARGS', |
| 639 | `${envName} must be an absolute ${kind} path, not ${JSON.stringify(rawPath)}`, |
| 640 | { envName, path: rawPath }, |
| 641 | ); |
| 642 | } |
| 643 | return candidate; |
| 644 | } |
| 645 | |
| 646 | function normalizeExecutableLookup(cmd: string): string | null { |
| 647 | const candidate = cmd.trim(); |
no outgoing calls
no test coverage detected