( command: string, exitCode: number, stdout: string, stderr: string, )
| 128 | * Interpret command result based on semantic rules |
| 129 | */ |
| 130 | export function interpretCommandResult( |
| 131 | command: string, |
| 132 | exitCode: number, |
| 133 | stdout: string, |
| 134 | stderr: string, |
| 135 | ): { |
| 136 | isError: boolean |
| 137 | message?: string |
| 138 | } { |
| 139 | const baseCommand = heuristicallyExtractBaseCommand(command) |
| 140 | const semantic = COMMAND_SEMANTICS.get(baseCommand) ?? DEFAULT_SEMANTIC |
| 141 | return semantic(exitCode, stdout, stderr) |
| 142 | } |
no test coverage detected