I'm running the Node JS child process spawn command to run some commands and am listening for some data from the commands that I run. Unfortunately, my script is exiting and I need it to remain running to monitor the progress of the terminals I'm opening automatically...
// command to run
const cmd = `ttab 'cd ${process.env.FORMS_FOLDER}application-${form} && dep deploy --tag="${release}" ${brand.stage}'`
// spawn a child process and
// run the command for deployment
const child = spawn(cmd, {
shell: true
})
child.stdout.on('data', (data) => {
console.log('STDOUT: ', data.toString()) // never running for some reason??
})
child.on('exit', function (code, signal) {
console.log('child process exited with ' + `code ${code} and signal ${signal}`) // script is exiting?
})