(base: string)
| 87 | * fails on win32, try .exe / .cmd / .bat. Linux/macOS behavior is unchanged. |
| 88 | */ |
| 89 | export function findExecutable(base: string): string | null { |
| 90 | if (isExecutable(base)) return base; |
| 91 | if (process.platform === "win32") { |
| 92 | for (const ext of [".exe", ".cmd", ".bat"]) { |
| 93 | const withExt = base + ext; |
| 94 | if (isExecutable(withExt)) return withExt; |
| 95 | } |
| 96 | } |
| 97 | return null; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Locate the browse binary. Throws a BrowseClientError with a |
no test coverage detected