Skip to content

Commit 0eb462a

Browse files
committed
generate contract js file
1 parent 4f90e62 commit 0eb462a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/pipeline/pipeline.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,13 @@ class Pipeline {
9797

9898
buildContractJS(contractName) {
9999
let contractJSON = fs.readFileSync('dist/contracts/' + contractName + '.json').toString();
100+
let EmbarkJSLib = fs.readFileSync(fs.embarkPath("js/embark.js")).toString();
100101

101102
let contractCode = "";
102103
contractCode += contractName + "JSONConfig = " + contractJSON + ";\n";
104+
contractCode += EmbarkJSLib + "\n";
103105
contractCode += contractName + " = new EmbarkJS.Contract(" + contractName + "JSONConfig);\n";
106+
contractCode += "module.exports = " + contractName + ";\n";
104107

105108
return contractCode;
106109
}

0 commit comments

Comments
 (0)