0
Fork 0
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:
Hannah Wolfe 2014-03-24 16:24:22 +00:00
commit bd417339fc

View file

@ -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 () {