re-add register upload cmd api; refactor storage module initialization

This commit is contained in:
Iuri Matias 2018-07-08 20:40:06 +03:00 committed by Pascal Precht
parent bd13626d49
commit a1e72e38ef
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 7 additions and 1 deletions

View File

@ -22,6 +22,7 @@ var Plugin = function(options) {
this.serviceChecks = []; this.serviceChecks = [];
this.dappGenerators = []; this.dappGenerators = [];
this.pluginTypes = []; this.pluginTypes = [];
this.uploadCmds = [];
this.imports = []; this.imports = [];
this.embarkjs_code = []; this.embarkjs_code = [];
this.embarkjs_init_code = {}; this.embarkjs_init_code = {};
@ -187,6 +188,11 @@ Plugin.prototype.registerCompiler = function(extension, cb) {
this.addPluginType('compilers'); this.addPluginType('compilers');
}; };
Plugin.prototype.registerUploadCommand = function(cmd, cb) {
this.uploadCmds.push({cmd: cmd, cb: cb});
this.addPluginType('uploadCmds');
};
Plugin.prototype.addCodeToEmbarkJS = function(code) { Plugin.prototype.addCodeToEmbarkJS = function(code) {
this.embarkjs_code.push(code); this.embarkjs_code.push(code);
this.addPluginType('embarkjsCode'); this.addPluginType('embarkjsCode');

View File

@ -1,6 +1,6 @@
class Storage { class Storage {
constructor(embark, options){ constructor(embark, _options){
this.embark = embark; this.embark = embark;
this.storageConfig = embark.config.storageConfig; this.storageConfig = embark.config.storageConfig;
this.plugins = options.plugins; this.plugins = options.plugins;