mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-09 21:46:12 +00:00
nodashboard start a repl
This commit is contained in:
parent
559eb0636e
commit
ff94680f42
@ -1,4 +1,5 @@
|
|||||||
const repl = require("repl");
|
const repl = require("repl");
|
||||||
|
const RunCode = require('../coderunner/runCode');
|
||||||
|
|
||||||
class REPL {
|
class REPL {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
@ -6,16 +7,21 @@ class REPL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start(done) {
|
start(done) {
|
||||||
let replServer = repl.start({
|
this.replServer = repl.start({
|
||||||
prompt: "Embark (" + this.env + ") > "
|
prompt: "Embark (" + this.env + ") > "
|
||||||
});
|
});
|
||||||
|
this.initializeContext(this.replServer.context);
|
||||||
|
|
||||||
replServer.on('exit', () => {
|
this.replServer.on("exit", () => {
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initializeContext(context) {
|
||||||
|
context.embark = RunCode.getContext();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = REPL;
|
module.exports = REPL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user