1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Fixes #2117: Prevent synch from happening if target dir could not be created, in local sync

This commit is contained in:
Laurent Cozic
2019-11-21 19:54:09 +00:00
parent 5b0a817d69
commit 707828ca76

View File

@ -82,7 +82,13 @@ class FsDriverNode extends FsDriverBase {
}
async mkdir(path) {
return fs.mkdirp(path);
// Note that mkdirp() does not throw an error if the directory
// could not be created. This would make the synchroniser to
// incorrectly try to sync with a non-existing dir:
// https://github.com/laurent22/joplin/issues/2117
const r = await fs.mkdirp(path);
if (!(await this.exists(path))) throw new Error(`Could not create directory: ${path}`);
return r;
}
async stat(path) {