checkPlugin: Only consider `README{,.md}` (case-insensitive)

This avoids false positives such as `README-foo.md`.
pull/5323/head
Richard Hansen 2021-06-17 17:30:38 -04:00
parent 753d16af8a
commit 9a85bce212
1 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@ if (autoPush) {
let repository; let repository;
const files = rootFiles.map((f) => { const files = rootFiles.map((f) => {
const fl = f.toLowerCase(); const fl = f.toLowerCase();
if (fl.includes('readme')) readMeFileName = f; if (fl === 'readme' || f === 'readme.md') readMeFileName = f;
return fl; return fl;
}); });
@ -215,7 +215,7 @@ if (autoPush) {
console.warn('Run npm install in the plugin folder and commit the package-lock.json file.'); console.warn('Run npm install in the plugin folder and commit the package-lock.json file.');
} }
} }
if (!files.includes('readme') && !files.includes('readme.md')) { if (!readMeFileName) {
console.warn('README.md file not found, please create'); console.warn('README.md file not found, please create');
if (autoFix) { if (autoFix) {
console.log('Autofixing missing README.md file'); console.log('Autofixing missing README.md file');