From 9a85bce21254413d195e9e924e3bab3430af71c5 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 17 Jun 2021 17:30:38 -0400 Subject: [PATCH] checkPlugin: Only consider `README{,.md}` (case-insensitive) This avoids false positives such as `README-foo.md`. --- src/bin/plugins/checkPlugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/plugins/checkPlugin.js b/src/bin/plugins/checkPlugin.js index b7a45f3fb..5488d642b 100755 --- a/src/bin/plugins/checkPlugin.js +++ b/src/bin/plugins/checkPlugin.js @@ -139,7 +139,7 @@ if (autoPush) { let repository; const files = rootFiles.map((f) => { const fl = f.toLowerCase(); - if (fl.includes('readme')) readMeFileName = f; + if (fl === 'readme' || f === 'readme.md') readMeFileName = f; return fl; }); @@ -215,7 +215,7 @@ if (autoPush) { 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'); if (autoFix) { console.log('Autofixing missing README.md file');