Ensure output is posted to console after child process finishes (#5)
diff --git a/lib/paramedic.js b/lib/paramedic.js
index a386bb7..a748674 100644
--- a/lib/paramedic.js
+++ b/lib/paramedic.js
@@ -332,8 +332,18 @@
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;
});
})