mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修改任务队列执行日志
This commit is contained in:
+7
-3
@@ -298,13 +298,17 @@ export function readDir(
|
||||
return result;
|
||||
}
|
||||
|
||||
export function emptyDir(path: string) {
|
||||
export async function emptyDir(path: string) {
|
||||
const pathExist = await fileExist(path);
|
||||
if (!pathExist) {
|
||||
return;
|
||||
}
|
||||
const files = fs.readdirSync(path);
|
||||
files.forEach((file) => {
|
||||
files.forEach(async (file) => {
|
||||
const filePath = `${path}/${file}`;
|
||||
const stats = fs.statSync(filePath);
|
||||
if (stats.isDirectory()) {
|
||||
emptyDir(filePath);
|
||||
await emptyDir(filePath);
|
||||
} else {
|
||||
fs.unlinkSync(filePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user