fix issue where the created file will still be collected and merged

This commit is contained in:
antoKeinanen 2023-05-05 19:07:03 +03:00
parent 411a7bd00b
commit 7a6f9e67fd

10
main.ts
View file

@ -12,11 +12,6 @@ export default class AdvancedMerge extends Plugin {
.onClick(async () => {
const { vault } = this.app;
const destination = await vault.create(
`${folder.path}-merged.md`,
""
);
const files = vault
.getMarkdownFiles()
.filter(
@ -35,6 +30,11 @@ export default class AdvancedMerge extends Plugin {
return 0;
});
const destination = await vault.create(
`${folder.path}-merged.md`,
""
);
files.forEach(async (file) => {
let contents = await vault.read(file);
contents = `\n# ${file.name.replace(