From cf0dc06818afee655b03c7f2c39e9351d179db8d Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 23 Jul 2018 17:05:01 +0100 Subject: [PATCH] nodashboard start a repl --- lib/dashboard/repl.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/dashboard/repl.js b/lib/dashboard/repl.js index f416bc941..1dd5181f6 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;