(cmd: string, args: string[], timeoutMs: number)
| 201 | interface RunResult { exitCode: number; stdout: string; stderr: string } |
| 202 | |
| 203 | function tryRun(cmd: string, args: string[], timeoutMs: number): RunResult | null { |
| 204 | try { |
| 205 | const r = spawnSync(cmd, args, { encoding: 'utf-8', timeout: timeoutMs }); |
| 206 | if (r.error) return null; |
| 207 | return { |
| 208 | exitCode: r.status ?? 1, |
| 209 | stdout: r.stdout ?? '', |
| 210 | stderr: r.stderr ?? '', |
| 211 | }; |
| 212 | } catch { |
| 213 | return null; |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | /** Pretty single-block summary for the wizard / `qx setup --check`. */ |
| 218 | export function formatHardwareSummary(p: HardwareProfile): string { |
no outgoing calls
no test coverage detected