MCPcopy Create free account
hub / github.com/SethGammon/Citadel / runShell

Function runShell

scripts/loop-runner.js:35–51  ·  view source on GitHub ↗
(command, cwd)

Source from the content-addressed store, hash-verified

33}
34
35function runShell(command, cwd) {
36 const startedAt = new Date().toISOString();
37 const result = spawnSync(command, {
38 cwd,
39 shell: true,
40 encoding: 'utf8',
41 stdio: ['ignore', 'pipe', 'pipe'],
42 });
43 return {
44 command,
45 exitCode: result.status === null ? 1 : result.status,
46 stdout: String(result.stdout || '').slice(-4000),
47 stderr: String(result.stderr || '').slice(-4000),
48 startedAt,
49 completedAt: new Date().toISOString(),
50 };
51}
52
53function main() {
54 if (hasFlag('--help') || hasFlag('-h')) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected