| 14 | } |
| 15 | |
| 16 | function run(command, args) { |
| 17 | const result = spawnSync(command, args, { |
| 18 | encoding: 'utf8', |
| 19 | stdio: ['pipe', 'pipe', 'pipe'], |
| 20 | shell: process.platform === 'win32', |
| 21 | }); |
| 22 | return { |
| 23 | command: [command, ...args].join(' '), |
| 24 | status: result.status, |
| 25 | pass: result.status === 0, |
| 26 | stdout: (result.stdout || '').slice(0, 4000), |
| 27 | stderr: (result.stderr || '').slice(0, 4000), |
| 28 | error: result.error ? result.error.message : null, |
| 29 | }; |
| 30 | } |
| 31 | |
| 32 | if (process.argv.includes('--help')) { |
| 33 | console.log('Usage: node scripts/codex-plugin-smoke.js [--project-root PATH] [--plugin-path PATH] [--write] [--live] [--add-marketplace]'); |