From 317a63cbecfc0e16344c50520afb6986556b0da9 Mon Sep 17 00:00:00 2001 From: Drayke Date: Tue, 13 Apr 2021 13:54:51 +0200 Subject: [PATCH] fix(email-plugin): Added filename filter for json files (#821) Co-authored-by: Kevin Mattutat --- packages/email-plugin/src/dev-mailbox.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/email-plugin/src/dev-mailbox.ts b/packages/email-plugin/src/dev-mailbox.ts index e10a14aab7..ebb8e0cb35 100644 --- a/packages/email-plugin/src/dev-mailbox.ts +++ b/packages/email-plugin/src/dev-mailbox.ts @@ -83,7 +83,7 @@ export class DevMailbox { private async getEmailList(outputPath: string) { const list = await fs.readdir(outputPath); const contents: any[] = []; - for (const fileName of list) { + for (const fileName of list.filter(name => name.endsWith('.json'))) { const json = await fs.readFile(path.join(outputPath, fileName), 'utf-8'); const content = JSON.parse(json); contents.push({