( outStream: Writable, suppressGitCmdOutput: boolean )
| 425 | } |
| 426 | |
| 427 | const outStreamHandler = ( |
| 428 | outStream: Writable, |
| 429 | suppressGitCmdOutput: boolean |
| 430 | ): Writable => { |
| 431 | return new stream.Writable({ |
| 432 | write(chunk, _, next) { |
| 433 | if (suppressGitCmdOutput) { |
| 434 | const lines = chunk.toString().trimEnd().split('\n') |
| 435 | for (const line of lines) { |
| 436 | if (line.startsWith('[command]')) { |
| 437 | outStream.write(`${line}\n`) |
| 438 | } |
| 439 | } |
| 440 | } else { |
| 441 | outStream.write(chunk) |
| 442 | } |
| 443 | next() |
| 444 | } |
| 445 | }) |
| 446 | } |