MCPcopy
hub / github.com/coder/mux / getBashPathForPlatform

Function getBashPathForPlatform

src/node/utils/main/bashPath.ts:204–222  ·  view source on GitHub ↗
(params: GetBashPathForPlatformParams)

Source from the content-addressed store, hash-verified

202}
203
204export 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

Callers 2

bashPath.test.tsFile · 0.90
getBashPathFunction · 0.85

Calls 1

findWindowsBashFunction · 0.85

Tested by

no test coverage detected