Skip to content

Commit

Permalink
Avoid finding temp files like .readme.md.swp (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillForan authored Jan 1, 2024
1 parent c3c8ee3 commit 6559118
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/find-readme-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6559118

Please sign in to comment.