فهرست منبع

Fix emptyDirectory helper

Loris Leiva 1 سال پیش
والد
کامیت
89c83d34ab
1فایلهای تغییر یافته به همراه1 افزوده شده و 5 حذف شده
  1. 1 5
      index.ts

+ 1 - 5
index.ts

@@ -59,10 +59,6 @@ function emptyDirectory(directory: string) {
   for (const filename of fs.readdirSync(directory)) {
     if (filename === ".git") continue;
     const fullpath = path.resolve(directory, filename);
-    if (fs.lstatSync(fullpath).isDirectory()) {
-      fs.rmdirSync(fullpath);
-    } else {
-      fs.unlinkSync(fullpath);
-    }
+    fs.rmSync(fullpath, { recursive: true });
   }
 }