0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Set backup file encoding as utf8

- we write files in the default encoding (which is `utf8`) and this
  files a types issue with `JSON.parse` operating on a Buffer
This commit is contained in:
Daniel Lockyer 2023-02-27 17:48:41 +01:00
parent 268e72309f
commit 1a04e75e8b
No known key found for this signature in database

View file

@ -31,7 +31,7 @@ const readBackup = async (filename) => {
const exists = await fs.pathExists(backupPath);
if (exists) {
const backupFile = await fs.readFile(backupPath);
const backupFile = await fs.readFile(backupPath, 'utf8');
return JSON.parse(backupFile);
} else {
return null;