(params: GetBashPathForPlatformParams)
| 202 | } |
| 203 | |
| 204 | export function getBashPathForPlatform(params: GetBashPathForPlatformParams): string { |
| 205 | if (params.platform !== "win32") { |
| 206 | return "bash"; |
| 207 | } |
| 208 | |
| 209 | const bashPath = findWindowsBash({ |
| 210 | env: params.env ?? process.env, |
| 211 | execSyncFn: params.execSyncFn ?? defaultExecSync, |
| 212 | existsSyncFn: params.existsSyncFn ?? existsSync, |
| 213 | }); |
| 214 | |
| 215 | if (!bashPath) { |
| 216 | throw new Error( |
| 217 | "Git Bash not found. On Windows, mux requires Git for Windows (Git Bash). WSL is not supported. Install Git for Windows from https://git-scm.com/download/win" |
| 218 | ); |
| 219 | } |
| 220 | |
| 221 | return bashPath; |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * Get the bash executable path for the current platform |
no test coverage detected