build: Preserve newlines when gathering stdout

If the chunk happens to end in a new line or other meaningful
whitespace, stripping it can lead to two words (e.g. targets)
being squished together and broken.
This commit is contained in:
Jan Martin 2025-02-03 12:33:51 -08:00 committed by Jan Olaf Martin
parent 7a8ff1f099
commit c48a2da287

View File

@ -38,7 +38,7 @@ function _exec(cmd: string, captureStdout: boolean): Promise<string> {
proc.stdout.on('data', (data) => {
console.info(data.toString().trim());
if (captureStdout) {
output += data.toString().trim();
output += data.toString();
}
});
proc.stderr.on('data', (data) => console.info(data.toString().trim()));