1
0
Fork 0
forked from svrjs/svrjs

Lint out the codebase.

This commit is contained in:
Dorian Niemiec 2024-08-24 19:50:01 +02:00
parent 8be7735e71
commit eb0d30f307

View file

@ -4,9 +4,11 @@ function deleteFolderRecursive(path) {
if (fs.existsSync(path)) { if (fs.existsSync(path)) {
fs.readdirSync(path).forEach(function (file) { fs.readdirSync(path).forEach(function (file) {
const curPath = path + "/" + file; const curPath = path + "/" + file;
if (fs.statSync(curPath).isDirectory()) { // recurse if (fs.statSync(curPath).isDirectory()) {
// recurse
deleteFolderRecursive(curPath); deleteFolderRecursive(curPath);
} else { // delete file } else {
// delete file
fs.unlinkSync(curPath); fs.unlinkSync(curPath);
} }
}); });
@ -14,4 +16,4 @@ function deleteFolderRecursive(path) {
} }
} }
module.exports = deleteFolderRecursive; module.exports = deleteFolderRecursive;