Skip to content

Commit

Permalink
Fix logging on 'yarn' (#228)
Browse files Browse the repository at this point in the history
fixed #210

Signed-off-by: Jonas Helming <[email protected]>
  • Loading branch information
JonasHelming authored Oct 16, 2024
1 parent 584887f commit 81b072e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,21 @@ module.exports = class TheiaExtension extends Base {
const command = spawn('yarn', []);

command.stdout.on('data', (data: Buffer) => {
console.log(`stdout: ${data}`);
const output = data.toString().trim();
if (output) {
console.log(output);
}
});

command.stderr.on('data', (data: Buffer) => {
console.warn(`stderr: ${data}`);
const output = data.toString().trim();
if (output.includes('warning')) {
console.warn(output);
} else if (output) {
console.error(output);
}
});

command.on('close', (code: number) => {
console.log(`yarn process exited with code ${code}`);
});
Expand Down

0 comments on commit 81b072e

Please sign in to comment.