MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / tryRun

Function tryRun

src/setup/hardware-profile.ts:203–215  ·  view source on GitHub ↗
(cmd: string, args: string[], timeoutMs: number)

Source from the content-addressed store, hash-verified

201interface RunResult { exitCode: number; stdout: string; stderr: string }
202
203function 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`. */
218export function formatHardwareSummary(p: HardwareProfile): string {

Callers 2

detectGpuFunction · 0.85
detectFreeDiskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected