now profiler and other plugins will be able to benefit from undefined return output for logs only plugins

Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
VoR0220 2018-05-18 08:54:25 -05:00
parent c2086b94ae
commit 5af4eb5b25
3 changed files with 14 additions and 5 deletions

View File

@ -38,22 +38,30 @@ class Console {
var pluginCmds = this.plugins.getPluginsProperty('console', 'console'); var pluginCmds = this.plugins.getPluginsProperty('console', 'console');
for (let pluginCmd of pluginCmds) { for (let pluginCmd of pluginCmds) {
let pluginOutput = pluginCmd.call(this, cmd, {}); let pluginOutput = pluginCmd.call(this, cmd, {});
if (pluginOutput !== false && pluginOutput !== 'false') return callback(pluginOutput); //console.log("plugin output: ", pluginOutput)
if (pluginOutput !== false && pluginOutput !== 'false')
return callback(pluginOutput);
else if (pluginOutput === undefined)
return;
} }
//console.log("Do we hit the here?")
let output = this.processEmbarkCmd(cmd); let output = this.processEmbarkCmd(cmd);
console.log("Output: ", output);
if (output) { if (output) {
return callback(output); return callback(output);
} }
console.log("What about the here?")
try { try {
let result = RunCode.doEval(cmd); let result = RunCode.doEval(cmd);
console.log("RESULT: ", result)
return callback(result); return callback(result);
} }
catch (e) { catch (e) {
if (e.message.indexOf('not defined') > 0) { if (e.message.indexOf('not defined') > 0) {
console.log("Hit here in indexOf")
return callback(("error: " + e.message).red + ("\n" + __("Type") + " " + "help".bold + " " + __("to see the list of available commands")).cyan); return callback(("error: " + e.message).red + ("\n" + __("Type") + " " + "help".bold + " " + __("to see the list of available commands")).cyan);
} else { } else {
console.log("Still hit the catch")
return callback(e.message); return callback(e.message);
} }
} }

View File

@ -368,7 +368,8 @@ class Dashboard {
const self = this; const self = this;
self.logText.log('console> '.bold.green + cmd); self.logText.log('console> '.bold.green + cmd);
self.console.executeCmd(cmd, function (result) { self.console.executeCmd(cmd, function (result) {
self.logText.log(result); if (result !== undefined)
self.logText.log(result);
if (cb) { if (cb) {
cb(result); cb(result);
} }

View File

@ -48,7 +48,7 @@ class Profiler {
this.profile(contractName, contract); this.profile(contractName, contract);
}); });
} }
return false; return;
}); });
} }
} }