(
command: string,
deps: {
isCommandAvailable: (candidateCommand: string) => boolean;
isPathAccessible: (candidatePath: string) => boolean;
}
)
| 97 | } |
| 98 | |
| 99 | function isCandidateAvailable( |
| 100 | command: string, |
| 101 | deps: { |
| 102 | isCommandAvailable: (candidateCommand: string) => boolean; |
| 103 | isPathAccessible: (candidatePath: string) => boolean; |
| 104 | } |
| 105 | ): boolean { |
| 106 | if (!command) { |
| 107 | return false; |
| 108 | } |
| 109 | |
| 110 | if (isPathLikeShell(command)) { |
| 111 | return deps.isPathAccessible(command); |
| 112 | } |
| 113 | |
| 114 | return deps.isCommandAvailable(command); |
| 115 | } |
| 116 | |
| 117 | function looksLikeWslShell(envShell: string): boolean { |
| 118 | // WSL (and other Unix-like environments) often surface POSIX-y paths like `/bin/bash`. |
no test coverage detected