Skip to content

Commit

Permalink
fix: more yarn debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Aug 11, 2023
1 parent 76031d7 commit 1a733da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ export default class Yarn {
spawn(executable: string, args: string[] = [], options: any = {}): Promise<void> {
return new Promise((resolve, reject) => {
const spawned = spawn(executable, args, {...options, shell: true})
spawned.stderr.on('data', (d: any) => process.stderr.write(d))
spawned.stderr.setEncoding('utf8')
spawned.stderr.on('data', (d: any) => {
debug('spawned yarn stderr:', d)
process.stderr.write(d)
})
spawned.stdout.setEncoding('utf8')
spawned.stdout.on('data', (d: any) => {
debug('spawned yarn stdout:', d)
if (options.verbose) process.stdout.write(d)
else ux.action.status = d.replace(/\n$/, '').split('\n').pop()
})
Expand Down

0 comments on commit 1a733da

Please sign in to comment.