Ghost/core/server/data/import/index.js

18 lines
321 B
JavaScript
Raw Normal View History

var when = require('when');
2013-06-16 00:52:03 +04:00
module.exports = function (version, data) {
var importer;
2013-06-16 00:52:03 +04:00
try {
importer = require("./" + version);
} catch (ignore) {
// Zero effs given
}
2013-06-16 00:52:03 +04:00
if (!importer) {
return when.reject("No importer found");
}
2013-06-16 00:52:03 +04:00
return importer.importData(data);
};