MCPcopy Index your code
hub / github.com/dmno-dev/bumpy / run

Function run

packages/bumpy/src/utils/shell.ts:33–45  ·  view source on GitHub ↗
(cmd: string, opts?: { cwd?: string; input?: string })

Source from the content-addressed store, hash-verified

31// ---- String-based commands (for static/trusted command strings only) ----
32
33export function run(cmd: string, opts?: { cwd?: string; input?: string }): string {
34 const result = checkIntercept(cmd.split(/\s+/), opts);
35 if (result?.intercepted) {
36 if ('error' in result) throw new Error(result.error);
37 return result.result;
38 }
39 return execSync(cmd, {
40 cwd: opts?.cwd,
41 input: opts?.input,
42 encoding: 'utf-8',
43 stdio: [opts?.input ? 'pipe' : 'pipe', 'pipe', 'pipe'],
44 }).trim();
45}
46
47export function runAsync(cmd: string, opts?: { cwd?: string; input?: string }): Promise<string> {
48 const result = checkIntercept(cmd.split(/\s+/), opts);

Callers 3

installPackageFunction · 0.90
uninstallPackageFunction · 0.90
tryRunFunction · 0.85

Calls 1

checkInterceptFunction · 0.85

Tested by

no test coverage detected