Skip to content

Commit

Permalink
Ensure output is posted to console after child process finishes (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
johanlantz authored and janpio committed Nov 24, 2018
1 parent d726584 commit 4997a3e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/paramedic.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,18 @@ ParamedicRunner.prototype.runLocalTests = function () {
if (self.config.getPlatformId() !== util.BROWSER) {
return execPromise(command);
}
runProcess = cp.exec(command, function () {
// a precaution not to try to kill some other process
// We do not wait for the child process to finish, server connects when deployed and ready.
runProcess = cp.exec(command, (error, stdout, stderr) => {
if (error) {
// This won't show up until the process completes:
console.log('[ERROR]: Running cordova run failed');

console.log(stdout);
console.log(stderr);
reject(error);
}
console.log(stdout);
console.log(stderr);
runProcess = null;
});
})
Expand Down

0 comments on commit 4997a3e

Please sign in to comment.