Do not forget callbacks

This commit is contained in:
Daniel García Aubert 2019-01-21 17:15:14 +01:00
parent ca8634530e
commit 26252f3841

View File

@ -15,9 +15,14 @@ headerString = headerString.replace("{{version}}", packageJSON.version)
['torque.uncompressed.js'].forEach(function(v){
fs.readFile('dist/' + v, 'utf8', function(err, torque) {
if(!err){
var torqueString = headerString.replace("{{lib}}", torque);
fs.writeFile('dist/' + v, torqueString);
if (err) {
return console.error(err);
}
var torqueString = headerString.replace("{{lib}}", torque);
fs.writeFile('dist/' + v, torqueString, function (err) {
if (err) {
return console.error(err);
}
});
});
});