From 65591184d019cbc9a0773dec0bf5e6d31d1c83a0 Mon Sep 17 00:00:00 2001 From: Will Foran Date: Mon, 1 Jan 2024 01:52:01 -0500 Subject: [PATCH] Avoid finding temp files like `.readme.md.swp` (#184) --- lib/find-readme-file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/find-readme-file.js b/lib/find-readme-file.js index 7678a1b..ae1b9c1 100644 --- a/lib/find-readme-file.js +++ b/lib/find-readme-file.js @@ -3,7 +3,7 @@ import path from 'node:path'; export default function findReadmeFile(directory) { const readmeFile = fs.readdirSync(directory).find(filename => ( - /readme|readme\.md|readme\.markdown|readme.txt/i.test(filename) + /^(readme|readme\.md|readme\.markdown|readme.txt)$/i.test(filename) )); if (readmeFile) {