generate contract js file

This commit is contained in:
Iuri Matias 2017-06-28 06:46:38 -04:00
parent 4f90e62790
commit 0eb462a89c

View File

@ -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;
}