replace fs.rmdir to fs.rm
This commit is contained in:
1 parent
64259e37f4
commit
d18ffaafc6
1 file changed
+1
-1
+1
-1
@@ -22,7 +22,7 @@ function deletePath(targetPath) {
|
||||
// console.log('delete file')
|
||||
} else if (stats.isDirectory()) {
|
||||
// 如果是文件夹,递归删除
|
||||
fs.rmdir(targetPath, { recursive: true }, (err) => {
|
||||
fs.rm(targetPath, { recursive: true }, (err) => {
|
||||
if (err) return reject(err);
|
||||
resolve(); // 删除成功
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user