mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Lots of bugfixes, improvements: Dinamyc QA, file uploading refactoring, file managing logging improvements ...
This commit is contained in:
parent
3250139c82
commit
b8c1a6ca97
14 changed files with 662 additions and 533 deletions
22
utils.js
Normal file → Executable file
22
utils.js
Normal file → Executable 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue