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

Function ssh

e2e/cli/election-cold-start.test.ts:53–68  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

51};
52
53const ssh = async (command: string): Promise<{ stdout: string; stderr: string; code: number }> => {
54 const invocation = sshInvocation(command);
55 try {
56 const { stdout, stderr } = await execFileAsync(invocation.command, [...invocation.args], {
57 maxBuffer: 64 * 1024 * 1024,
58 });
59 return { stdout, stderr, code: 0 };
60 } catch (error) {
61 const err = error as { stdout?: string; stderr?: string; code?: number };
62 return {
63 stdout: err.stdout ?? "",
64 stderr: err.stderr ?? "",
65 code: typeof err.code === "number" ? err.code : 1,
66 };
67 }
68};
69
70const exePath = (): string => {
71 const dir = process.env.E2E_CLI_BIN_DIR ?? (guestOs() === "windows" ? "C:/ed" : "~/ed");

Callers 1

Calls 1

sshInvocationFunction · 0.70

Tested by

no test coverage detected