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:
parent
268e72309f
commit
1a04e75e8b
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue