1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Desktop: Fixes #1425: Improved handling of images when using external editor, so that it works in Atom, VSCode and Typora

This commit is contained in:
Laurent Cozic
2019-05-11 11:46:13 +01:00
parent 91ecab51c5
commit b702b0b40c
7 changed files with 36 additions and 16 deletions

View File

@@ -38,6 +38,18 @@ class FsDriverBase {
}
}
async removeAllThatStartWith(dirPath, filenameStart) {
if (!filenameStart || !dirPath) throw new Error('dirPath and filenameStart cannot be empty');
const stats = await this.readDirStats(dirPath);
for (const stat of stats) {
if (stat.path.indexOf(filenameStart) === 0) {
await this.remove(dirPath + '/' + stat.path);
}
}
}
}
module.exports = FsDriverBase;