Writing .bin after output is complete
This commit is contained in:
parent
74fbf9d046
commit
31b2cfc7f6
|
@ -65,19 +65,28 @@ function compileSolc(embark, contractFiles, cb) {
|
|||
compiled_object[className].abiDefinition = JSON.parse(contract.abi);
|
||||
compiled_object[className].filename = fileName;
|
||||
|
||||
if(outputBinary){
|
||||
fs.writeFile(outputDir + className + ".bin", contract.bin, (err) => {
|
||||
if (err) logger.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
fileCb();
|
||||
});
|
||||
},
|
||||
function (err) {
|
||||
cb(err, compiled_object);
|
||||
cb(err, compiled_object);
|
||||
|
||||
embark.events.on("outputDone", function() {
|
||||
if(outputBinary){
|
||||
Object.keys(compiled_object).map(function(className, index) {
|
||||
fs.writeFile(outputDir + className + ".bin", compiled_object[className].bin, (err) => {
|
||||
if (err) {
|
||||
logger.error("Error writing binary file: " + JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue