From 2d7876146ba77efef14b5fb1a497a5dcb55910f3 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Tue, 24 Jul 2018 09:40:48 +0100 Subject: [PATCH] Use global in repl --- lib/coderunner/runCode.js | 7 +------ lib/dashboard/repl.js | 8 ++------ lib/index.js | 6 +++++- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/coderunner/runCode.js b/lib/coderunner/runCode.js index 7d0104107..9560eec1f 100644 --- a/lib/coderunner/runCode.js +++ b/lib/coderunner/runCode.js @@ -23,13 +23,8 @@ function registerVar(varName, code) { __mainContext[varName] = code; } -function getContext() { - return __mainContext; -} - module.exports = { doEval: doEval, registerVar: registerVar, - initContext: initContext, - getContext: getContext + initContext: initContext }; diff --git a/lib/dashboard/repl.js b/lib/dashboard/repl.js index 1dd5181f6..d9a0dd014 100644 --- a/lib/dashboard/repl.js +++ b/lib/dashboard/repl.js @@ -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; diff --git a/lib/index.js b/lib/index.js index 63a2beb25..266a4064c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -270,6 +270,7 @@ class Embark { engine.startService("libraryManager"); engine.startService("codeRunner"); engine.startService("web3"); + engine.startService("pipeline"); engine.startService("deployment", {onlyCompile: false}); engine.startService("storage"); engine.startService("codeGenerator"); @@ -283,7 +284,10 @@ class Embark { }, function waitForWriteFinish(callback) { engine.logger.info("Finished deploying".underline); - callback(); + engine.events.on('outputDone', (err) => { + engine.logger.info(__("finished building").underline); + callback(err); + }); }, function startREPL(callback) { let repl = new REPL({env: engine.env});