mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 14:24:24 +00:00
fix: log command in console
This commit is contained in:
parent
ebcc3c4a8d
commit
1334900eae
@ -139,6 +139,7 @@ class Console {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private executeCmd(cmd: string, callback: any) {
|
private executeCmd(cmd: string, callback: any) {
|
||||||
|
this.logger.info("console>", cmd);
|
||||||
if (!(cmd.split(" ")[0] === "history" || cmd === __("history"))) {
|
if (!(cmd.split(" ")[0] === "history" || cmd === __("history"))) {
|
||||||
this.saveHistory(cmd);
|
this.saveHistory(cmd);
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,15 @@
|
|||||||
let Console = require('../lib/modules/console/');
|
let Console = require('../lib/modules/console/');
|
||||||
let Plugins = require('../lib/core/plugins.js');
|
let Plugins = require('../lib/core/plugins.js');
|
||||||
let IPC = require('../lib/core/ipc.js');
|
let IPC = require('../lib/core/ipc.js');
|
||||||
|
let Logger = require('../lib/core/logger.js');
|
||||||
let assert = require('assert');
|
let assert = require('assert');
|
||||||
let version = require('../../package.json').version;
|
let version = require('../../package.json').version;
|
||||||
|
|
||||||
describe('embark.Console', function() {
|
describe('embark.Console', function() {
|
||||||
let ipc = new IPC({ipcRole: 'none'});
|
let ipc = new IPC({ipcRole: 'none'});
|
||||||
let events = {once: () => {}, setCommandHandler: () => {}, emit: () => {}, on: () => {}, request: () => {}};
|
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 = {
|
let embarkObject = {
|
||||||
registerAPICall: () => {},
|
registerAPICall: () => {},
|
||||||
events: events,
|
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() {
|
describe('#executeCmd', function() {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user