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

Function runVerification

scripts/pr-ready.js:80–107  ·  view source on GitHub ↗
(projectRoot, command)

Source from the content-addressed store, hash-verified

78}
79
80function runVerification(projectRoot, command) {
81 if (!command) {
82 return { status: 'skipped', command: '', exitCode: null, stdout: '', stderr: '' };
83 }
84
85 const parts = splitCommand(command);
86 if (parts.length === 0) {
87 return { status: 'skipped', command, exitCode: null, stdout: '', stderr: '' };
88 }
89
90 const isWindowsNpm = process.platform === 'win32' && parts[0] === 'npm';
91 const executable = isWindowsNpm ? 'cmd.exe' : parts[0];
92 const commandArgs = isWindowsNpm ? ['/d', '/s', '/c', 'npm', ...parts.slice(1)] : parts.slice(1);
93 const result = spawnSync(executable, commandArgs, {
94 cwd: projectRoot,
95 encoding: 'utf8',
96 stdio: ['ignore', 'pipe', 'pipe'],
97 shell: false,
98 });
99
100 return {
101 status: result.status === 0 ? 'pass' : 'fail',
102 command,
103 exitCode: result.status ?? 1,
104 stdout: result.stdout || '',
105 stderr: result.stderr || '',
106 };
107}
108
109function validatePrUrl(pr) {
110 if (!pr) return 'missing pull request URL';

Callers 1

assessReadinessFunction · 0.85

Calls 1

splitCommandFunction · 0.70

Tested by

no test coverage detected