diff --git a/cmd/cmd_controller.js b/cmd/cmd_controller.js index beef7db0c..143fa2502 100644 --- a/cmd/cmd_controller.js +++ b/cmd/cmd_controller.js @@ -107,6 +107,7 @@ class EmbarkController { plugins: engine.plugins, version: engine.version, events: engine.events, + logger: engine.logger, ipc: engine.ipc }).startConsole(); return callback(); @@ -342,6 +343,7 @@ class EmbarkController { plugins: engine.plugins, version: engine.version, events: engine.events, + logger: engine.logger, ipc: engine.ipc }); repl.start(callback); diff --git a/cmd/dashboard/console.js b/cmd/dashboard/console.js index 2ef31d290..6496ba207 100644 --- a/cmd/dashboard/console.js +++ b/cmd/dashboard/console.js @@ -5,6 +5,7 @@ class Console { this.events = options.events; this.plugins = options.plugins; this.version = options.version; + this.logger = options.logger; this.ipc = options.ipc; if (this.ipc.isServer()) { @@ -38,7 +39,13 @@ class Console { var pluginCmds = this.plugins.getPluginsProperty('console', 'console'); for (let pluginCmd of pluginCmds) { let pluginResult = pluginCmd.call(this, cmd, {}); - if (pluginResult.match()) { + if(typeof pluginResult !== 'object'){ + if (pluginResult !== false && pluginResult !== 'false' && pluginResult !== undefined) { + this.logger.warn("[DEPRECATED] In future versions of embark, we expect the console command to return an object " + + "having 2 functions: match and process."); + return callback(null, pluginResult); + } + } else if (pluginResult.match()) { return pluginResult.process(callback); } } diff --git a/cmd/dashboard/dashboard.js b/cmd/dashboard/dashboard.js index d1727f7d1..107ebb979 100644 --- a/cmd/dashboard/dashboard.js +++ b/cmd/dashboard/dashboard.js @@ -34,7 +34,8 @@ class Dashboard { events: self.events, plugins: self.plugins, version: self.version, - ipc: self.ipc + ipc: self.ipc, + logger: self.logger }); callback(); }, diff --git a/cmd/dashboard/repl.js b/cmd/dashboard/repl.js index 1951c4f13..0432943b8 100644 --- a/cmd/dashboard/repl.js +++ b/cmd/dashboard/repl.js @@ -5,6 +5,7 @@ const Console = require('./console.js'); class REPL { constructor(options) { + this.logger = options.logger; this.env = options.env; this.plugins = options.plugins; this.events = options.events; @@ -17,7 +18,8 @@ class REPL { events: this.events, plugins: this.plugins, version: this.version, - ipc: this.ipc + ipc: this.ipc, + logger: this.logger }); } diff --git a/lib/modules/webserver/index.js b/lib/modules/webserver/index.js index 8c0ac7eab..cfd5d7baf 100644 --- a/lib/modules/webserver/index.js +++ b/lib/modules/webserver/index.js @@ -54,7 +54,7 @@ class WebServer { return { match: () => cmd === "webserver start", process: (callback) => self.events.request("start-webserver", callback) - } + }; }); self.embark.registerConsoleCommand((cmd, _options) => {