1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/ReactNativeClient/lib/services/InteropService_Importer_Enex.js

23 lines
687 B
JavaScript
Raw Normal View History

const InteropService_Importer_Base = require('lib/services/InteropService_Importer_Base');
const Folder = require('lib/models/Folder.js');
2019-07-29 15:58:33 +02:00
const { filename } = require('lib/path-utils.js');
class InteropService_Importer_Enex extends InteropService_Importer_Base {
async exec(result) {
2018-02-27 22:04:38 +02:00
const { importEnex } = require('lib/import-enex');
let folder = this.options_.destinationFolder;
if (!folder) {
const folderTitle = await Folder.findUniqueItemTitle(filename(this.sourcePath_));
folder = await Folder.save({ title: folderTitle });
}
await importEnex(folder.id, this.sourcePath_, this.options_);
return result;
}
}
2019-07-29 15:43:53 +02:00
module.exports = InteropService_Importer_Enex;