use event for when engine is ready to deploy

This commit is contained in:
Jonathan Rainville 2018-05-22 11:07:58 -04:00
parent 47591a39dd
commit c6b555af4e
1 changed files with 11 additions and 10 deletions

View File

@ -151,16 +151,17 @@ class Embark {
engine.logger.info(__("Ready").underline);
engine.events.emit("status", __("Ready").green);
});
engine.deployManager.deployContracts(function (err) {
engine.startService("fileWatcher");
if (options.runWebserver) {
engine.startService("webServer", {
host: options.serverHost,
port: options.serverPort
});
}
callback(err);
engine.events.on('engine-ready', function () {
engine.deployManager.deployContracts(function (err) {
engine.startService("fileWatcher");
if (options.runWebserver) {
engine.startService("webServer", {
host: options.serverHost,
port: options.serverPort
});
}
callback(err);
});
});
}
], function (err, _result) {