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

Function run

scripts/live-github-steward-proof.js:49–65  ·  view source on GitHub ↗
(command, commandArgs, options = {})

Source from the content-addressed store, hash-verified

47}
48
49function run(command, commandArgs, options = {}) {
50 const result = childProcess.spawnSync(command, commandArgs, {
51 cwd: options.cwd || process.cwd(),
52 encoding: 'utf8',
53 input: options.input,
54 stdio: options.inherit ? 'inherit' : ['pipe', 'pipe', 'pipe'],
55 });
56 if (result.error) throw result.error;
57 if (result.status !== 0) {
58 throw new Error([
59 `${command} ${commandArgs.join(' ')} failed with exit ${result.status}`,
60 result.stdout,
61 result.stderr,
62 ].filter(Boolean).join('\n'));
63 }
64 return result.stdout || '';
65}
66
67function gh(args, options = {}) {
68 return run('gh', args, options).trim();

Callers 3

ghFunction · 0.70
gitFunction · 0.70
runStewardCycleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected