mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-08 02:52:39 -05:00
Merge pull request #2494 from halfdan/2493-import-tmp
Unlink import file when finished
This commit is contained in:
commit
bd417339fc
1 changed files with 4 additions and 1 deletions
|
@ -38,7 +38,7 @@ db = {
|
|||
return api.settings.read({ key: 'databaseVersion' }).then(function (setting) {
|
||||
return when(setting.value);
|
||||
}, function () {
|
||||
return when('001');
|
||||
return when('002');
|
||||
}).then(function (version) {
|
||||
databaseVersion = version;
|
||||
// Read the file contents
|
||||
|
@ -82,6 +82,9 @@ db = {
|
|||
return when.resolve({message: 'Posts, tags and other data successfully imported'});
|
||||
}).otherwise(function importFailure(error) {
|
||||
return when.reject({code: 500, message: error.message || error});
|
||||
}).finally(function () {
|
||||
// Unlink the file after import
|
||||
return nodefn.call(fs.unlink, options.importfile.path);
|
||||
});
|
||||
},
|
||||
'deleteAllContent': function () {
|
||||
|
|
Loading…
Add table
Reference in a new issue