( commandPath: string, platform: Platform = process.platform, exists: ExistsFn = existsSync, )
| 22 | } |
| 23 | |
| 24 | export function resolveWindowsCommandShim( |
| 25 | commandPath: string, |
| 26 | platform: Platform = process.platform, |
| 27 | exists: ExistsFn = existsSync, |
| 28 | ): string { |
| 29 | const candidate = trimCommandPath(commandPath); |
| 30 | if (!candidate || platform !== "win32" || getKnownWindowsExtension(candidate)) { |
| 31 | return candidate; |
| 32 | } |
| 33 | |
| 34 | for (const ext of WINDOWS_EXECUTABLE_EXTENSIONS) { |
| 35 | const pathWithExtension = `${candidate}${ext}`; |
| 36 | if (exists(pathWithExtension)) return pathWithExtension; |
| 37 | } |
| 38 | |
| 39 | return candidate; |
| 40 | } |
| 41 | |
| 42 | export function resolveCommandFromWhichOutput( |
| 43 | output: string, |
no test coverage detected