Fix for #18
This commit is contained in:
parent
4d85640d44
commit
cb1f7f4b60
1 changed files with 5 additions and 0 deletions
|
|
@ -100,6 +100,11 @@ export default class MediaDbPlugin extends Plugin {
|
||||||
const fileName = replaceIllegalFileNameCharactersInString(this.mediaTypeManager.getFileName(mediaTypeModel));
|
const fileName = replaceIllegalFileNameCharactersInString(this.mediaTypeManager.getFileName(mediaTypeModel));
|
||||||
const filePath = `${this.settings.folder.replace(/\/$/, '')}/${fileName}.md`;
|
const filePath = `${this.settings.folder.replace(/\/$/, '')}/${fileName}.md`;
|
||||||
|
|
||||||
|
const folder = this.app.vault.getAbstractFileByPath(this.settings.folder);
|
||||||
|
if (!folder) {
|
||||||
|
await this.app.vault.createFolder(this.settings.folder.replace(/\/$/, ''));
|
||||||
|
}
|
||||||
|
|
||||||
const file = this.app.vault.getAbstractFileByPath(filePath);
|
const file = this.app.vault.getAbstractFileByPath(filePath);
|
||||||
if (file) {
|
if (file) {
|
||||||
await this.app.vault.delete(file);
|
await this.app.vault.delete(file);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue