mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 08:38:18 +00:00
删除用户
This commit is contained in:
19
node_modules/common.js
generated
vendored
19
node_modules/common.js
generated
vendored
@@ -272,6 +272,23 @@ var Common = {
|
||||
md5sum.update(key);
|
||||
str = md5sum.digest('hex');
|
||||
return str;
|
||||
}
|
||||
},
|
||||
|
||||
// 删除文件夹
|
||||
deleteFolderRecursive: function(path) {
|
||||
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);
|
||||
} else { // delete file
|
||||
fs.unlinkSync(curPath);
|
||||
}
|
||||
});
|
||||
fs.rmdirSync(path);
|
||||
}
|
||||
},
|
||||
};
|
||||
module.exports = Common;
|
||||
|
Reference in New Issue
Block a user