From c376cd9000eb7b3c08a9bd8473cfd4504b72c9b2 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 3dcf2cd2d..719205024 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 7a984f074..b0d1d73d8 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 %>"; });