From 0c14834e576e515a159b99c1e13836b2fb540f62 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 8 Jul 2018 23:41:37 +0300 Subject: [PATCH] fix plugin call --- lib/core/engine.js | 2 +- lib/modules/storage/index.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/core/engine.js b/lib/core/engine.js index 9afbf9cea..b95f58f94 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -253,7 +253,7 @@ class Engine { } storageService(_options) { - this.registerModule('storage'); + this.registerModule('storage', {plugins: this.plugins}); this.registerModule('ipfs'); this.registerModule('swarm'); } diff --git a/lib/modules/storage/index.js b/lib/modules/storage/index.js index 5ac7712e2..c6bbb32f7 100644 --- a/lib/modules/storage/index.js +++ b/lib/modules/storage/index.js @@ -1,8 +1,9 @@ class Storage { - constructor(embark, _options){ + constructor(embark, options){ this.embark = embark; this.storageConfig = embark.config.storageConfig; + this.plugins = options.plugins; if (!this.storageConfig.enabled) return; @@ -15,7 +16,7 @@ class Storage { this.embark.events.setCommandHandler('storage:upload', (cb) => { let platform = self.storageConfig.upload.provider; - let uploadCmds = self.embark.getPluginsProperty('uploadCmds', 'uploadCmds'); + let uploadCmds = self.plugins.getPluginsProperty('uploadCmds', 'uploadCmds'); for (let uploadCmd of uploadCmds) { if (uploadCmd.cmd === platform) { return uploadCmd.cb.call(uploadCmd.cb, cb);