* Helper to run the CLI via entrypoint.js (the actual bin entry)
(
args: string[],
options: { cwd?: string; env?: NodeJS.ProcessEnv } = {},
)
| 44 | * Helper to run the CLI via entrypoint.js (the actual bin entry) |
| 45 | */ |
| 46 | function runEntrypoint( |
| 47 | args: string[], |
| 48 | options: { cwd?: string; env?: NodeJS.ProcessEnv } = {}, |
| 49 | ): { stdout: string; stderr: string; exitCode: number } { |
| 50 | const result = spawnSync('node', [ENTRYPOINT_PATH, ...args], { |
| 51 | cwd: options.cwd || ROOT_DIR, |
| 52 | encoding: 'utf-8', |
| 53 | env: { ...process.env, ...options.env, NO_COLOR: '1' }, |
| 54 | timeout: 30000, |
| 55 | }); |
| 56 | |
| 57 | return { |
| 58 | stdout: result.stdout || '', |
| 59 | stderr: result.stderr || '', |
| 60 | exitCode: result.status ?? 1, |
| 61 | }; |
| 62 | } |
| 63 | |
| 64 | function runEntrypointAsync( |
| 65 | args: string[], |
no outgoing calls
no test coverage detected
searching dependent graphs…