From 38817ddab22da0780f118887cc11d787d44355d8 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 18 Jul 2018 10:49:44 -0400 Subject: [PATCH] Add environment to EmbarkJS --- lib/contracts/code_generator.js | 2 +- lib/contracts/code_templates/do-when-loaded.js.ejs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/contracts/code_generator.js b/lib/contracts/code_generator.js index 3dcf2cd2..71920502 100644 --- a/lib/contracts/code_generator.js +++ b/lib/contracts/code_generator.js @@ -139,7 +139,7 @@ class CodeGenerator { web3Load = Templates.web3_connector({connectionList: connectionList, done: 'done(err);', warnAboutMetamask: isDev}); } - result += Templates.do_when_loaded({block: web3Load}); + result += Templates.do_when_loaded({block: web3Load, environment: this.env}); } return result; diff --git a/lib/contracts/code_templates/do-when-loaded.js.ejs b/lib/contracts/code_templates/do-when-loaded.js.ejs index 7a984f07..b0d1d73d 100644 --- a/lib/contracts/code_templates/do-when-loaded.js.ejs +++ b/lib/contracts/code_templates/do-when-loaded.js.ejs @@ -1,6 +1,8 @@ whenEnvIsLoaded(function(){ __mainContext.__loadManagerInstance.doFirst(function(done) { <%- block %> - }) + }); + + EmbarkJS.environment = "<%- environment %>"; });