(
command: string,
{
platform,
env,
cwd,
}: {
platform: NodeJS.Platform;
env: NodeJS.ProcessEnv;
cwd: string;
},
)
| 698 | } |
| 699 | |
| 700 | function resolveExplicitCommandPath( |
| 701 | command: string, |
| 702 | { |
| 703 | platform, |
| 704 | env, |
| 705 | cwd, |
| 706 | }: { |
| 707 | platform: NodeJS.Platform; |
| 708 | env: NodeJS.ProcessEnv; |
| 709 | cwd: string; |
| 710 | }, |
| 711 | ): string | null { |
| 712 | if (!hasPathSeparator(command)) { |
| 713 | return null; |
| 714 | } |
| 715 | const hostCommand = normalizeCommandPathForHost(command, platform); |
| 716 | const basePath = path.isAbsolute(hostCommand) |
| 717 | ? hostCommand |
| 718 | : path.resolve(cwd, hostCommand); |
| 719 | for (const candidate of buildExplicitCandidates(basePath, platform, env)) { |
| 720 | if (isCommandFile(candidate)) { |
| 721 | return candidate; |
| 722 | } |
| 723 | } |
| 724 | return null; |
| 725 | } |
| 726 | |
| 727 | function normalizeCommandPathForHost(command: string, platform: NodeJS.Platform): string { |
| 728 | if (platform !== 'win32' || path.sep !== '/') { |
no test coverage detected