I'm trying to do something I think is very simple -- execute an 'echo' line using child_process.exec and then inside callback if no error then do something. My code looks as such:
var {exec} = require('child_process');
exec('echo "HELLO"', (error, stdout, stderr) => {
if(error)
{
}
else
{
// do something
}
});
It executes an 'echo' line But it's not going inside the callback function and executing that if else statement. Is there something I'm missing here?