From 0eb462a89c615135b43cc9c0757806a93406a4a2 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 28 Jun 2017 06:46:38 -0400 Subject: [PATCH] generate contract js file --- lib/pipeline/pipeline.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index a7e7ace9..77f5eb20 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -97,10 +97,13 @@ class Pipeline { buildContractJS(contractName) { let contractJSON = fs.readFileSync('dist/contracts/' + contractName + '.json').toString(); + let EmbarkJSLib = fs.readFileSync(fs.embarkPath("js/embark.js")).toString(); let contractCode = ""; contractCode += contractName + "JSONConfig = " + contractJSON + ";\n"; + contractCode += EmbarkJSLib + "\n"; contractCode += contractName + " = new EmbarkJS.Contract(" + contractName + "JSONConfig);\n"; + contractCode += "module.exports = " + contractName + ";\n"; return contractCode; }