-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Hi all... Thank you for this lib :D...
I ha ve doubt, how can I run a long run command, for example docker build
, print the logs on terminal but at the same time getting the complete output to be evaluated later?...
Case 1:
const result = await exec('docker', ['buildx', 'build', '....'])
This works fine and I get the stderr
, stdout
, and exitCode
inside result
variable, and I can do a console log to print the output using console.log, but because the command takes a while, it's a bad experience because the user can't see the progress while the command runs...
Case 2:
const res = await exec('docker', ['buildx', 'build', '....'], {nodeOptions: { stdio: 'inherit' }})
With stdio: 'inherit'
I can see the progress in realtime but stderr
and stdout
are always empty strings in the result
variable, so cannot be used for extra analysis of the output...
I want to print the progress in realtime but also get the complete output in the result variable... How can I do that?