Fix crash when ./persist directory exists and tries to be recreated

This commit is contained in:
powermaker450 2024-08-21 03:05:35 -04:00
parent 159ef008de
commit 4367e5a944

View file

@ -14,7 +14,7 @@ export function checkFile(
final = !data.toString().trim() ? [] : JSON.parse(data.toString());
} else {
fs.mkdirSync(dir);
!fs.existsSync(dir) && fs.mkdirSync(dir);
fs.createWriteStream(fullPath);
final = [];
}