mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 16:04:56 +00:00
删除用户优化
This commit is contained in:
3
node_modules/common.js
generated
vendored
3
node_modules/common.js
generated
vendored
@@ -276,13 +276,14 @@ var Common = {
|
||||
|
||||
// 删除文件夹
|
||||
deleteFolderRecursive: function(path) {
|
||||
var me = this;
|
||||
var files = [];
|
||||
if( fs.existsSync(path) ) {
|
||||
files = fs.readdirSync(path);
|
||||
files.forEach(function(file,index){
|
||||
var curPath = path + "/" + file;
|
||||
if(fs.statSync(curPath).isDirectory()) { // recurse
|
||||
deleteFolderRecursive(curPath);
|
||||
me.deleteFolderRecursive(curPath);
|
||||
} else { // delete file
|
||||
fs.unlinkSync(curPath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user