MCPcopy Create free account
hub / github.com/backnotprop/plannotator / resolveWindowsCommandShim

Function resolveWindowsCommandShim

packages/ai/providers/command-path.ts:24–40  ·  view source on GitHub ↗
(
	commandPath: string,
	platform: Platform = process.platform,
	exists: ExistsFn = existsSync,
)

Source from the content-addressed store, hash-verified

22}
23
24export 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
42export function resolveCommandFromWhichOutput(
43 output: string,

Callers 6

ai.test.tsFile · 0.90
spawnMethod · 0.90
doStartMethod · 0.90
spawnMethod · 0.90
createAIRuntimeFunction · 0.90

Calls 3

trimCommandPathFunction · 0.85
getKnownWindowsExtensionFunction · 0.85
existsFunction · 0.85

Tested by

no test coverage detected