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

Function runCli

e2e/local/server-profile-header-env.test.ts:20–48  ·  view source on GitHub ↗
(
  dataDir: string,
  args: ReadonlyArray<string>,
  env: Record<string, string> = {},
)

Source from the content-addressed store, hash-verified

18const execFileAsync = promisify(execFile);
19
20const runCli = async (
21 dataDir: string,
22 args: ReadonlyArray<string>,
23 env: Record<string, string> = {},
24): Promise<string> => {
25 try {
26 const { stdout } = await execFileAsync("bun", ["run", CLI_ENTRY, ...args], {
27 cwd: repoRoot,
28 env: {
29 ...process.env,
30 EXECUTOR_DATA_DIR: dataDir,
31 EXECUTOR_DISABLE_UPDATE_CHECK: "1",
32 ...env,
33 },
34 maxBuffer: 1024 * 1024,
35 timeout: 60_000,
36 });
37 return stdout;
38 } catch (cause) {
39 const error = cause as {
40 readonly code?: number | string;
41 readonly stdout?: string;
42 readonly stderr?: string;
43 };
44 throw new Error(
45 `executor ${args.join(" ")} failed with ${error.code ?? "unknown"}\n${error.stdout ?? ""}\n${error.stderr ?? ""}`,
46 );
47 }
48};
49
50scenario(
51 "CLI server profiles · header env mappings are persisted without secret values",

Calls

no outgoing calls

Tested by

no test coverage detected