1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Fixed unlink() required callback in NodeJS v10.

This commit is contained in:
Ylian Saint-Hilaire 2019-01-06 20:32:12 -08:00
parent a1883fc178
commit ed5b5cbd34
4 changed files with 4 additions and 10 deletions

View file

@ -384,7 +384,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
for (i in command.names) {
var s = obj.path.join(scpath, command.names[i]), d = obj.path.join(path, command.names[i]);
sendUpdate = false;
copyFile(s, d, function (op) { if (op != null) { obj.fs.unlink(op, function () { obj.parent.parent.DispatchEvent([user._id], obj, 'updatefiles'); }); } else { obj.parent.parent.DispatchEvent([user._id], obj, 'updatefiles'); } }, ((command.fileop == 'move') ? s : null));
copyFile(s, d, function (op) { if (op != null) { obj.fs.unlink(op, function (err) { obj.parent.parent.DispatchEvent([user._id], obj, 'updatefiles'); }); } else { obj.parent.parent.DispatchEvent([user._id], obj, 'updatefiles'); } }, ((command.fileop == 'move') ? s : null));
}
}
@ -724,7 +724,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
{
// Clear the server error log
if ((user.siteadmin & 16) == 0) break;
obj.parent.parent.fs.unlink(obj.parent.parent.getConfigFilePath('mesherrors.txt'));
obj.parent.parent.fs.unlink(obj.parent.parent.getConfigFilePath('mesherrors.txt'), function (err) { });
break;
}
case 'createmesh':