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

New MeshMessenger and fixed server crash on some file copy.

This commit is contained in:
Ylian Saint-Hilaire 2019-10-30 14:30:34 -07:00
parent cba8476f61
commit 3c4f6f6bb7
12 changed files with 112 additions and 62 deletions

View file

@ -2691,11 +2691,13 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Delete a folder and all sub items. (TODO: try to make all async version)
function deleteFolderRec(path) {
if (obj.fs.existsSync(path) == false) return;
obj.fs.readdirSync(path).forEach(function (file, index) {
var pathx = path + "/" + file;
if (obj.fs.lstatSync(pathx).isDirectory()) { deleteFolderRec(pathx); } else { obj.fs.unlinkSync(pathx); }
});
obj.fs.rmdirSync(path);
try {
obj.fs.readdirSync(path).forEach(function (file, index) {
var pathx = path + '/' + file;
if (obj.fs.lstatSync(pathx).isDirectory()) { deleteFolderRec(pathx); } else { obj.fs.unlinkSync(pathx); }
});
obj.fs.rmdirSync(path);
} catch (ex) { }
}
// Handle Intel AMT events