Skip to content

Commit

Permalink
fix issue where the created file will still be collected and merged
Browse files Browse the repository at this point in the history
  • Loading branch information
antoKeinanen committed May 5, 2023
1 parent 411a7bd commit 7a6f9e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 7a6f9e6

Please sign in to comment.