ソースを参照

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 });
   }
 }