( stdout: string, stderr: string, inline = false, )
| 143 | } |
| 144 | |
| 145 | function formatBashOutput( |
| 146 | stdout: string, |
| 147 | stderr: string, |
| 148 | inline = false, |
| 149 | ): string { |
| 150 | const parts: string[] = [] |
| 151 | |
| 152 | if (stdout.trim()) { |
| 153 | parts.push(stdout.trim()) |
| 154 | } |
| 155 | |
| 156 | if (stderr.trim()) { |
| 157 | if (inline) { |
| 158 | parts.push(`[stderr: ${stderr.trim()}]`) |
| 159 | } else { |
| 160 | parts.push(`[stderr]\n${stderr.trim()}`) |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | return parts.join(inline ? ' ' : '\n') |
| 165 | } |
| 166 | |
| 167 | function formatBashError(e: unknown, pattern: string, inline = false): never { |
| 168 | if (e instanceof ShellError) { |
no test coverage detected