From 4997a3eaa8ef955d4edda24bb073dc60f68f7bba Mon Sep 17 00:00:00 2001 From: johanlantz Date: Fri, 22 Jun 2018 10:36:01 +0200 Subject: [PATCH] Ensure output is posted to console after child process finishes (#5) --- lib/paramedic.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/paramedic.js b/lib/paramedic.js index 591949fa..45ca10d0 100644 --- a/lib/paramedic.js +++ b/lib/paramedic.js @@ -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; }); })