Using rm instead of rmDir

This commit is contained in:
2024-04-27 14:44:59 +02:00
parent fb79c2d10e
commit 9b07aa9493
6 changed files with 27 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
import fs from "fs";
export const destructivelyRecreateDirectory = (directoryPath: string) => {
if (fs.existsSync(directoryPath)) {
fs.rmdirSync(directoryPath, { recursive: true });
fs.rmSync(directoryPath, { recursive: true });
}
fs.mkdirSync(directoryPath, { recursive: true });
};