From 411ed41c84a9c15703955fda42f04c26d82994e7 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 29 Dec 2017 18:21:36 -0500 Subject: [PATCH] fix console cmds api --- lib/core/plugin.js | 6 ------ lib/dashboard/console.js | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/core/plugin.js b/lib/core/plugin.js index 9fe984f9..7950706f 100644 --- a/lib/core/plugin.js +++ b/lib/core/plugin.js @@ -155,12 +155,6 @@ Plugin.prototype.addProviderInit = function(providerType, code, initCondition) { this.pluginTypes.push('initCode'); }; -Plugin.prototype.runCommands = function(cmd, options) { - return this.console.map(function(cb) { - return cb.call(this, cmd, options); - }).join("\n"); -}; - Plugin.prototype.runFilePipeline = function() { var self = this; diff --git a/lib/dashboard/console.js b/lib/dashboard/console.js index be6ba7da..d995a66e 100644 --- a/lib/dashboard/console.js +++ b/lib/dashboard/console.js @@ -55,10 +55,10 @@ class Console { executeCmd(cmd, callback) { let plugin, pluginOutput; - let plugins = this.plugins.getPluginsFor('console'); - for (let i = 0; i < plugins.length; i++) { - plugin = plugins[i]; - pluginOutput = plugin.runCommands(cmd, {}); + + var pluginCmds = this.plugins.getPluginsProperty('console', 'console'); + for (let pluginCmd of pluginCmds) { + let pluginOutput = pluginCmd.call(this, cmd, {}); if (pluginOutput !== false && pluginOutput !== 'false') return callback(pluginOutput); }