MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / gitBashCandidatesFromGitExecPath

Function gitBashCandidatesFromGitExecPath

packages/kaos/src/environment.ts:187–201  ·  view source on GitHub ↗
(execPath: string)

Source from the content-addressed store, hash-verified

185}
186
187function gitBashCandidatesFromGitExecPath(execPath: string): readonly string[] {
188 const normalized = nodePath.win32.normalize(normalizeWindowsPath(execPath));
189 const parts = normalized.split('\\');
190 for (let i = parts.length - 1; i >= 0; i -= 1) {
191 const segment = parts[i]?.toLowerCase();
192 if (segment === 'mingw32' || segment === 'mingw64') {
193 const root = parts.slice(0, i).join('\\');
194 if (root.length > 0) {
195 return gitBashCandidatesFromGitRoot(root);
196 }
197 }
198 }
199
200 return gitBashCandidatesFromGitRoot(nodePath.win32.join(normalized, '..', '..'));
201}
202
203function gitBashCandidatesFromGitRoot(root: string): readonly string[] {
204 return [

Callers 1

locateWindowsGitBashFunction · 0.85

Calls 2

normalizeWindowsPathFunction · 0.85

Tested by

no test coverage detected