Skip to content

Commit

Permalink
FIX: avoid temp files like .readme.md.swp
Browse files Browse the repository at this point in the history
  • Loading branch information
WillForan committed Dec 30, 2023
1 parent c3c8ee3 commit ac17262
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 ac17262

Please sign in to comment.