fix: log command in console

This commit is contained in:
Andre Medeiros 2019-02-19 10:01:22 -05:00 committed by Iuri Matias
parent ebcc3c4a8d
commit 1334900eae
2 changed files with 5 additions and 2 deletions

View File

@ -139,6 +139,7 @@ class Console {
}
private executeCmd(cmd: string, callback: any) {
this.logger.info("console>", cmd);
if (!(cmd.split(" ")[0] === "history" || cmd === __("history"))) {
this.saveHistory(cmd);
}

View File

@ -2,13 +2,15 @@
let Console = require('../lib/modules/console/');
let Plugins = require('../lib/core/plugins.js');
let IPC = require('../lib/core/ipc.js');
let Logger = require('../lib/core/logger.js');
let assert = require('assert');
let version = require('../../package.json').version;
describe('embark.Console', function() {
let ipc = new IPC({ipcRole: 'none'});
let events = {once: () => {}, setCommandHandler: () => {}, emit: () => {}, on: () => {}, request: () => {}};
let plugins = new Plugins({plugins: {}, events: events});
let logger = new Logger({logLevel: 'error'});
let plugins = new Plugins({plugins: {}, events, logger});
let embarkObject = {
registerAPICall: () => {},
events: events,
@ -27,7 +29,7 @@ describe('embark.Console', function() {
}
}
}
let console = new Console(embarkObject, {plugins, version, ipc, events});
let console = new Console(embarkObject, {plugins, version, ipc, events, logger});
describe('#executeCmd', function() {