1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-14 23:26:58 +02:00

All: Fixed filesystem driver bug when downloading resources. Added support for encrypting all items when encryption enabled.

This commit is contained in:
Laurent Cozic
2017-12-14 21:12:02 +00:00
parent e9bb5bee9d
commit f5d26e0d81
4 changed files with 37 additions and 4 deletions

View File

@@ -146,11 +146,17 @@ class FileApiDriverLocal {
let output = null;
try {
if (options.encoding == 'binary') {
output = fs.readFile(path);
if (options.target === 'file') {
output = await fs.copy(path, options.path, { overwrite: true });
} else {
output = fs.readFile(path, options.encoding);
output = await fs.readFile(path, options.encoding);
}
// if (options.encoding == 'binary') {
// output = await fs.readFile(path);
// } else {
// output = await fs.readFile(path, options.encoding);
// }
} catch (error) {
if (error.code == 'ENOENT') return null;
throw this.fsErrorToJsError_(error);