( cmd: string, args: string[], )
| 30 | let rawReadPromise: Promise<RawReadResult> | null = null |
| 31 | |
| 32 | function execFilePromise( |
| 33 | cmd: string, |
| 34 | args: string[], |
| 35 | ): Promise<{ stdout: string; code: number | null }> { |
| 36 | return new Promise(resolve => { |
| 37 | execFile( |
| 38 | cmd, |
| 39 | args, |
| 40 | { encoding: 'utf-8', timeout: MDM_SUBPROCESS_TIMEOUT_MS }, |
| 41 | (err, stdout) => { |
| 42 | // biome-ignore lint/nursery/noFloatingPromises: resolve() is not a floating promise |
| 43 | resolve({ stdout: stdout ?? '', code: err ? 1 : 0 }) |
| 44 | }, |
| 45 | ) |
| 46 | }) |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Fire fresh subprocess reads for MDM settings and return raw stdout. |
no test coverage detected