add new events for output generation and first deployment

This commit is contained in:
Iuri Matias 2017-03-05 11:00:47 -05:00
parent a797f8fcf6
commit 8325943bd7
3 changed files with 6 additions and 0 deletions

View File

@ -277,6 +277,9 @@ This call is used to listen and react to events that happen in Embark such as co
a file change, args is (filetype, path)
* "abi", "abi-vanila", "abi-contracts-vanila" - triggered when contracts
have been deployed and returns the generated JS code
* "outputDone" - triggered when dapp is (re)generated
* "firstDeploymentDone" - triggered when the dapp is deployed and generated
for the first time
.. code:: javascript

View File

@ -74,11 +74,13 @@ Engine.prototype.pipelineService = function(options) {
this.events.on('abi', function(abi) {
self.currentAbi = abi;
pipeline.build(abi);
self.events.emit('outputDone');
});
this.events.on('file-event', function(fileType, path) {
if (fileType === 'asset') {
self.config.reloadConfig();
pipeline.build(self.abi, path);
self.events.emit('outputDone');
}
});
};

View File

@ -127,6 +127,7 @@ var Embark = {
engine.logger.setStatus("Ready".green);
engine.logger.info("Looking for documentation? you can find it at ".cyan + "http://embark.readthedocs.io/".green.underline);
engine.logger.info("Ready".underline);
engine.events.emit('firstDeploymentDone');
}
});
},