(current: string, chunk: Buffer | string)
| 435 | const MAX_TAIL_CHARS = 4000; |
| 436 | let stderrTail = ''; |
| 437 | const appendTail = (current: string, chunk: Buffer | string): string => { |
| 438 | const text = chunk.toString(); |
| 439 | if (!text) { |
| 440 | return current; |
| 441 | } |
| 442 | const combined = current + text; |
| 443 | return combined.length > MAX_TAIL_CHARS ? combined.slice(-MAX_TAIL_CHARS) : combined; |
| 444 | }; |
| 445 | const logStderrTail = () => { |
| 446 | const trimmed = stderrTail.trim(); |
| 447 | if (!trimmed) { |