mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-09 13:36:14 +00:00
Add dedicated writer for string result
This commit is contained in:
parent
4858418efc
commit
f4a2ad7568
@ -1,4 +1,5 @@
|
||||
const repl = require("repl");
|
||||
const util = require("util");
|
||||
|
||||
const Console = require('./console.js');
|
||||
|
||||
@ -20,11 +21,20 @@ class REPL {
|
||||
});
|
||||
}
|
||||
|
||||
enhancedWriter(output) {
|
||||
if ((typeof output) === "string") {
|
||||
return output;
|
||||
} else {
|
||||
return util.inspect(output, {colors: true});
|
||||
}
|
||||
}
|
||||
|
||||
start(done) {
|
||||
this.replServer = repl.start({
|
||||
prompt: "Embark (" + this.env + ") > ",
|
||||
useGlobal: true,
|
||||
eval: this.enhancedEval.bind(this)
|
||||
eval: this.enhancedEval.bind(this),
|
||||
writer: this.enhancedWriter.bind(this)
|
||||
});
|
||||
|
||||
this.replServer.on("exit", () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user