Эх сурвалжийг харах

Fix emptyDirectory helper

Loris Leiva 1 жил өмнө
parent
commit
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 });
   }
 }