Skip to content

Commit 81b072e

Browse files
authored
Fix logging on 'yarn' (#228)
fixed #210 Signed-off-by: Jonas Helming <[email protected]>
1 parent 584887f commit 81b072e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/app/index.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,21 @@ module.exports = class TheiaExtension extends Base {
533533
const command = spawn('yarn', []);
534534

535535
command.stdout.on('data', (data: Buffer) => {
536-
console.log(`stdout: ${data}`);
536+
const output = data.toString().trim();
537+
if (output) {
538+
console.log(output);
539+
}
537540
});
541+
538542
command.stderr.on('data', (data: Buffer) => {
539-
console.warn(`stderr: ${data}`);
543+
const output = data.toString().trim();
544+
if (output.includes('warning')) {
545+
console.warn(output);
546+
} else if (output) {
547+
console.error(output);
548+
}
540549
});
550+
541551
command.on('close', (code: number) => {
542552
console.log(`yarn process exited with code ${code}`);
543553
});

0 commit comments

Comments
 (0)