Explorar el Código

Fix emptyDirectory helper

Loris Leiva hace 1 año
padre
commit
89c83d34ab
Se han modificado 1 ficheros con 1 adiciones y 5 borrados
  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 });
   }
 }