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

Function runStep

scripts/codex-install.js:42–80  ·  view source on GitHub ↗
({ name, command, args, cwd, dryRun, timeout = 60000, required = true })

Source from the content-addressed store, hash-verified

40}
41
42function runStep({ name, command, args, cwd, dryRun, timeout = 60000, required = true }) {
43 const rendered = display(command, args);
44 if (dryRun) {
45 return {
46 name,
47 command: rendered,
48 cwd,
49 required,
50 skipped: true,
51 pass: true,
52 status: 0,
53 stdout: '',
54 stderr: '',
55 json: null,
56 };
57 }
58
59 const result = spawnSync(command, args, {
60 cwd,
61 encoding: 'utf8',
62 stdio: ['ignore', 'pipe', 'pipe'],
63 shell: process.platform === 'win32' && command === 'codex',
64 timeout,
65 });
66
67 return {
68 name,
69 command: rendered,
70 cwd,
71 required,
72 skipped: false,
73 pass: result.status === 0,
74 status: result.status,
75 stdout: (result.stdout || '').slice(0, 12000),
76 stderr: (result.stderr || '').slice(0, 12000),
77 error: result.error ? result.error.message : null,
78 json: parseJson(result.stdout),
79 };
80}
81
82function printHuman(report) {
83 console.log('Citadel Codex install');

Callers 1

codex-install.jsFile · 0.70

Calls 2

displayFunction · 0.70
parseJsonFunction · 0.70

Tested by

no test coverage detected