feat: 초기 프로젝트 설정 및 룰.md 파일 추가
This commit is contained in:
19
api.hyungi.net/node_modules/pm2/lib/tools/deleteFolderRecursive.js
generated
vendored
Normal file
19
api.hyungi.net/node_modules/pm2/lib/tools/deleteFolderRecursive.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
const fs = require('fs');
|
||||
const Path = require('path');
|
||||
|
||||
const deleteFolderRecursive = function(path) {
|
||||
if (fs.existsSync(path)) {
|
||||
fs.readdirSync(path).forEach((file, index) => {
|
||||
const curPath = Path.join(path, file);
|
||||
if (fs.lstatSync(curPath).isDirectory()) { // recurse
|
||||
deleteFolderRecursive(curPath);
|
||||
} else { // delete file
|
||||
fs.unlinkSync(curPath);
|
||||
}
|
||||
});
|
||||
fs.rmdirSync(path);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = deleteFolderRecursive
|
||||
Reference in New Issue
Block a user