(result: ExecResult)
| 54 | } |
| 55 | |
| 56 | function cliJsonResult(result: ExecResult): CliJsonResult { |
| 57 | let json: any; |
| 58 | try { |
| 59 | json = JSON.parse(result.stdout ?? ''); |
| 60 | } catch { |
| 61 | json = undefined; |
| 62 | } |
| 63 | return { |
| 64 | status: result.exitCode, |
| 65 | json, |
| 66 | stdout: json ? '<JSON output>' : (result.stdout ?? ''), |
| 67 | stderr: result.stderr ?? '', |
| 68 | }; |
| 69 | } |
no test coverage detected