mirror of https://github.com/embarklabs/embark.git
Use global in repl
This commit is contained in:
parent
cf0dc06818
commit
30f9166aa8
|
@ -1,5 +1,4 @@
|
|||
const repl = require("repl");
|
||||
const RunCode = require('../coderunner/runCode');
|
||||
|
||||
class REPL {
|
||||
constructor(options) {
|
||||
|
@ -8,9 +7,9 @@ class REPL {
|
|||
|
||||
start(done) {
|
||||
this.replServer = repl.start({
|
||||
prompt: "Embark (" + this.env + ") > "
|
||||
prompt: "Embark (" + this.env + ") > ",
|
||||
useGlobal: true
|
||||
});
|
||||
this.initializeContext(this.replServer.context);
|
||||
|
||||
this.replServer.on("exit", () => {
|
||||
process.exit();
|
||||
|
@ -19,9 +18,6 @@ class REPL {
|
|||
done();
|
||||
}
|
||||
|
||||
initializeContext(context) {
|
||||
context.embark = RunCode.getContext();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = REPL;
|
||||
|
|
Loading…
Reference in New Issue