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:
parent
cba8476f61
commit
3c4f6f6bb7
12 changed files with 112 additions and 62 deletions
12
webserver.js
12
webserver.js
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue