From ce23be1bad513f0733d8ee2ac7ef2857dbdd58c7 Mon Sep 17 00:00:00 2001 From: Yogesh Gaonkar Date: Thu, 20 Aug 2020 15:55:08 +0530 Subject: [PATCH] 160431789 Pass plugin dirs names to plugin loader Pass all the plugin dir names to gateway's plugin loaders. --- cli/lib/gateway.js | 2 +- lib/plugins.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/lib/gateway.js b/cli/lib/gateway.js index 4b0219c18..cfc71def0 100644 --- a/cli/lib/gateway.js +++ b/cli/lib/gateway.js @@ -126,7 +126,7 @@ Gateway.prototype.start = (options,cb) => { delete args.keys; //set pluginDir if (!args.pluginDir) { - if (config.edgemicro.plugins.dir) { + if (config.edgemicro.plugins && config.edgemicro.plugins.dir) { args.pluginDir = path.resolve(config.edgemicro.plugins.dir); } } diff --git a/lib/plugins.js b/lib/plugins.js index 24878b09e..9f88d30b7 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -56,7 +56,7 @@ Plugins.prototype.loadPlugins = function () { plugin = isBuiltIn; } - gateway.addPlugin(pluginName, _.bind(plugin.init, plugin)); + gateway.addPlugin(pluginName, _.bind(plugin.init, plugin), combinedDirs); }); }