MCPcopy
hub / github.com/google-labs-code/design.md / exec

Function exec

packages/cli/scripts/check-package.ts:63–76  ·  view source on GitHub ↗
(cmd: string, opts?: { cwd?: string })

Source from the content-addressed store, hash-verified

61}
62
63function exec(cmd: string, opts?: { cwd?: string }): { ok: boolean; stdout: string; stderr: string } {
64 try {
65 const stdout = execSync(cmd, {
66 cwd: opts?.cwd ?? ROOT,
67 encoding: 'utf-8',
68 stdio: ['pipe', 'pipe', 'pipe'],
69 env: { ...process.env, PATH: `${process.env.HOME}/.bun/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${process.env.PATH ?? ''}` },
70 });
71 return { ok: true, stdout, stderr: '' };
72 } catch (e: unknown) {
73 const err = e as { stdout?: string; stderr?: string };
74 return { ok: false, stdout: err.stdout ?? '', stderr: err.stderr ?? '' };
75 }
76}
77
78// ── Phase 1: Pre-pack validation ───────────────────────────────────
79

Callers 3

phase2Function · 0.85
phase3Function · 0.85
phase4Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…