diff --git a/lib/dashboard/repl.js b/lib/dashboard/repl.js index f416bc94..1dd5181f 100644 --- a/lib/dashboard/repl.js +++ b/lib/dashboard/repl.js @@ -1,4 +1,5 @@ const repl = require("repl"); +const RunCode = require('../coderunner/runCode'); class REPL { constructor(options) { @@ -6,16 +7,21 @@ class REPL { } start(done) { - let replServer = repl.start({ + this.replServer = repl.start({ prompt: "Embark (" + this.env + ") > " }); + this.initializeContext(this.replServer.context); - replServer.on('exit', () => { + this.replServer.on("exit", () => { process.exit(); }); done(); } + + initializeContext(context) { + context.embark = RunCode.getContext(); + } } module.exports = REPL;