From faaefd349c146d660c77e35a67cd60fb548b8b6e Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 14 Jun 2018 10:30:34 -0400 Subject: [PATCH] fix afterDeploy not done and also waits for file build --- lib/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 1f73d7710..9e5a485fb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -202,13 +202,20 @@ class Embark { engine.deployManager.deployContracts(function (err) { callback(err); }); + }, + function waitForWriteFinish(callback) { + engine.logger.info("Finished deploying".underline); + // Necessary log for simple projects. This event is trigger to soon because there is no file + // Also, not exiting straight after the deploy leaves time for async afterDeploys to finish + engine.logger.info("If you have no files to build, you can exit now with CTRL+C"); + engine.events.on('outputDone', callback); } ], function (err, _result) { if (err) { engine.logger.error(err.message); engine.logger.debug(err.stack); } else { - engine.logger.info("finished building".underline); + engine.logger.info("Finished building".underline); } // needed due to child processes process.exit();