MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / sh

Function sh

e2e/scripts/cli.ts:97–105  ·  view source on GitHub ↗
(cmd: string, args: ReadonlyArray<string>)

Source from the content-addressed store, hash-verified

95];
96
97const sh = (cmd: string, args: ReadonlyArray<string>): Promise<{ ok: boolean; out: string }> =>
98 new Promise((resolve) => {
99 const child = spawn(cmd, [...args], { stdio: ["ignore", "pipe", "pipe"] });
100 let out = "";
101 child.stdout?.on("data", (d: Buffer) => (out += d.toString()));
102 child.stderr?.on("data", (d: Buffer) => (out += d.toString()));
103 child.on("error", () => resolve({ ok: false, out }));
104 child.on("exit", (code) => resolve({ ok: code === 0, out }));
105 });
106
107const findTailscale = async (): Promise<string | undefined> => {
108 for (const candidate of TAILSCALE_CANDIDATES) {

Callers 5

findTailscaleFunction · 0.70
tailnetDnsNameFunction · 0.70
runFunction · 0.70
shutdownFunction · 0.70
downFunction · 0.70

Calls 2

toStringMethod · 0.80
resolveFunction · 0.50

Tested by

no test coverage detected