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:
parent
5d015bf746
commit
02eb2f2e45
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user