Lots of bugfixes, improvements: Dinamyc QA, file uploading refactoring, file managing logging improvements ...

This commit is contained in:
YourFriendlyNeighborhoodDealer 2019-02-24 10:27:47 +01:00
parent 3250139c82
commit b8c1a6ca97
14 changed files with 662 additions and 533 deletions

22
utils.js Normal file → Executable file
View file

@ -6,7 +6,8 @@ module.exports = {
Beep: Beep,
WriteBackup: WriteBackup,
FileExists: FileExists,
CreatePath: CreatePath
CreatePath: CreatePath,
GetAllFilesFromFolder: GetAllFilesFromFolder
};
var fs = require('fs');
@ -86,3 +87,22 @@ function WriteBackup() {
console.log(e);
}
}
function GetAllFilesFromFolder(dir) {
var results = [];
fs.readdirSync(dir).forEach(function(file) {
file = dir + '/' + file;
var stat = fs.statSync(file);
if (stat && stat.isDirectory()) {
results = results.concat(_getAllFilesFromFolder(file));
} else results.push(file);
});
return results;
}