MCPcopy
hub / github.com/garrytan/gstack / sh

Function sh

test/skill-e2e-ship-idempotency.test.ts:70–77  ·  view source on GitHub ↗
(cmd: string, cwd: string)

Source from the content-addressed store, hash-verified

68
69 const setupLog: string[] = [];
70 const sh = (cmd: string, cwd: string): void => {
71 setupLog.push(`[${cwd}] ${cmd}`);
72 const result = spawnSync('bash', ['-c', cmd], { cwd, stdio: 'pipe', timeout: 15_000 });
73 if (result.status !== 0) {
74 const stderr = result.stderr?.toString() ?? '';
75 throw new Error(`fixture setup failed at "${cmd}":\n${stderr}\n--- log ---\n${setupLog.join('\n')}`);
76 }
77 };
78
79 // Bare remote.
80 sh(`git init --bare "${bareRemote}"`, root);

Callers 1

buildShippedFixtureFunction · 0.85

Calls 2

spawnSyncFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected