Skip to content

Commit

Permalink
chore: attempt to pipe next's stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
gvc committed Oct 18, 2024
1 parent fe6e737 commit fda1a0d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/cli/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,27 @@ async function storeDev(rootDir: string, tmpDir: string, coreDir: string, port:
shell: true,
cwd: tmpDir,
signal: devAbortController.signal,
stdio: 'inherit',
stdio: ['inherit', 'pipe', 'inherit'],
env: {
...process.env,
...envVars,
}
})

let nextStdout = ''
devProcess.stdout.on('data', function (chunk) {
nextStdout += chunk
const lines = nextStdout.split('\n')
while(lines.length > 1) {
const line = lines.shift()
console.log('[DISCOVERY] ', line)
}
nextStdout = lines.shift() || ''
})
devProcess.stdout.on('end', function () {
console.log('[DISCOVERY] ', nextStdout)
})

devProcess.on('close', () => {
devAbortController.abort()
})
Expand Down

0 comments on commit fda1a0d

Please sign in to comment.