MCPcopy Index your code
hub / github.com/coder/mux / defaultIsCommandAvailable

Function defaultIsCommandAvailable

src/node/utils/main/resolveLocalPtyShell.ts:22–35  ·  view source on GitHub ↗
(platform: NodeJS.Platform)

Source from the content-addressed store, hash-verified

20}
21
22function defaultIsCommandAvailable(platform: NodeJS.Platform): (command: string) => boolean {
23 return (command: string) => {
24 if (!command) return false;
25
26 try {
27 const result = spawnSync(platform === "win32" ? "where" : "which", [command], {
28 stdio: "ignore",
29 });
30 return result.status === 0;
31 } catch {
32 return false;
33 }
34 };
35}
36
37/**
38 * Check whether a path-like shell candidate is a real executable file.

Callers 1

resolveLocalPtyShellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected