0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Fix naming of export file during migration

No Issue
- The method that generates a filename for the export during
  a migration returns a promise, not the filename directly,
  so the export file was being named [object Object].
This commit is contained in:
Jason Williams 2014-07-31 16:22:05 +00:00
parent b7bfc35079
commit 8936b82014

View file

@ -44,10 +44,12 @@ backupDatabase = function backupDatabase() {
logInfo('Creating database backup');
return dataExport().then(function (exportedData) {
// Save the exported data to the file system for download
var fileName = path.resolve(config.paths.contentPath + '/data/' + dataExport.fileName());
return dataExport.fileName().then(function (fileName) {
fileName = path.resolve(config.paths.contentPath + '/data/' + fileName);
return nodefn.call(fs.writeFile, fileName, JSON.stringify(exportedData)).then(function () {
logInfo('Database backup written to: ' + fileName);
return nodefn.call(fs.writeFile, fileName, JSON.stringify(exportedData)).then(function () {
logInfo('Database backup written to: ' + fileName);
});
});
});
};