1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop, Cli: Resolves #1932: Use profile temp dir when exporting files

This commit is contained in:
Laurent Cozic 2019-10-02 19:22:32 +01:00
parent 5d015bf746
commit 02eb2f2e45
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,7 @@
/* eslint @typescript-eslint/no-unused-vars: 0, no-unused-vars: ["error", { "argsIgnorePattern": ".*" }], */
const Setting = require('lib/models/Setting');
class InteropService_Exporter_Base {
async init(destDir) {}
async processItem(ItemClass, item) {}
@ -24,7 +26,7 @@ class InteropService_Exporter_Base {
async temporaryDirectory_(createIt) {
const md5 = require('md5');
const tempDir = `${require('os').tmpdir()}/${md5(Math.random() + Date.now())}`;
const tempDir = `${Setting.value('tempDir')}/${md5(Math.random() + Date.now())}`;
if (createIt) await require('fs-extra').mkdirp(tempDir);
return tempDir;
}

View File

@ -1,3 +1,5 @@
const Setting = require('lib/models/Setting');
class InteropService_Importer_Base {
setMetadata(md) {
this.metadata_ = md;
@ -16,7 +18,7 @@ class InteropService_Importer_Base {
async temporaryDirectory_(createIt) {
const md5 = require('md5');
const tempDir = `${require('os').tmpdir()}/${md5(Math.random() + Date.now())}`;
const tempDir = `${Setting.value('tempDir')}/${md5(Math.random() + Date.now())}`;
if (createIt) await require('fs-extra').mkdirp(tempDir);
return tempDir;
}