Fix crash when ./persist directory exists and tries to be recreated
This commit is contained in:
parent
159ef008de
commit
4367e5a944
|
@ -14,7 +14,7 @@ export function checkFile(
|
||||||
|
|
||||||
final = !data.toString().trim() ? [] : JSON.parse(data.toString());
|
final = !data.toString().trim() ? [] : JSON.parse(data.toString());
|
||||||
} else {
|
} else {
|
||||||
fs.mkdirSync(dir);
|
!fs.existsSync(dir) && fs.mkdirSync(dir);
|
||||||
fs.createWriteStream(fullPath);
|
fs.createWriteStream(fullPath);
|
||||||
final = [];
|
final = [];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue