diff --git a/src/utils/deleteFolderRecursive.js b/src/utils/deleteFolderRecursive.js index b332360..790ab71 100644 --- a/src/utils/deleteFolderRecursive.js +++ b/src/utils/deleteFolderRecursive.js @@ -4,9 +4,11 @@ function deleteFolderRecursive(path) { if (fs.existsSync(path)) { fs.readdirSync(path).forEach(function (file) { const curPath = path + "/" + file; - if (fs.statSync(curPath).isDirectory()) { // recurse + if (fs.statSync(curPath).isDirectory()) { + // recurse deleteFolderRecursive(curPath); - } else { // delete file + } else { + // delete file fs.unlinkSync(curPath); } }); @@ -14,4 +16,4 @@ function deleteFolderRecursive(path) { } } -module.exports = deleteFolderRecursive; \ No newline at end of file +module.exports = deleteFolderRecursive;