MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / which

Function which

src/tools/shell/code-run.ts:92–102  ·  view source on GitHub ↗

Check if a binary is on PATH.

(cmd: string)

Source from the content-addressed store, hash-verified

90
91/** Check if a binary is on PATH. */
92async function which(cmd: string): Promise<string | null> {
93 return new Promise((resolve) => {
94 const p = spawn('which', [cmd]);
95 let out = '';
96 p.stdout.on('data', (d) => { out += d.toString(); });
97 p.on('exit', (code) => {
98 resolve(code === 0 ? out.trim() : null);
99 });
100 p.on('error', () => resolve(null));
101 });
102}
103
104/** Build a macOS sandbox profile that restricts writes to tempDir and optionally denies network. */
105function macosSandboxProfile(tempDir: string, allowNetwork: boolean): string {

Callers 1

executeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected