From d81546ad7bbe33f1023ffcb1d87ed02d78b2dbee Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 9 Dec 2021 21:32:28 -0500 Subject: [PATCH] checkPlugin: Delete Travis badge from README.md template --- src/bin/plugins/checkPlugin.js | 21 +-------------------- src/bin/plugins/lib/README.md | 2 -- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/bin/plugins/checkPlugin.js b/src/bin/plugins/checkPlugin.js index 5340d8157..4aff46c37 100755 --- a/src/bin/plugins/checkPlugin.js +++ b/src/bin/plugins/checkPlugin.js @@ -138,7 +138,6 @@ if (autoPush) { // some files we need to know the actual file name. Not compulsory but might help in the future. const readMeFileName = files.filter((f) => f === 'README' || f === 'README.md')[0]; - let repository; if (!files.includes('.git')) throw new Error('No .git folder, aborting'); prepareRepo(); @@ -155,16 +154,6 @@ if (autoPush) { await fsp.readFile(`${pluginPath}/package.json`, {encoding: 'utf8', flag: 'r'}); const parsedPackageJSON = JSON.parse(packageJSON); - if (!packageJSON.toLowerCase().includes('repository')) { - console.warn('No repository in package.json'); - if (autoFix) { - console.warn('Repository not detected in package.json. Add repository section.'); - } - } else { - // useful for creating README later. - repository = parsedPackageJSON.repository.url; - } - await updateDeps(parsedPackageJSON, 'devDependencies', { 'eslint': '^7.32.0', 'eslint-config-etherpad': '^2.0.2', @@ -220,15 +209,7 @@ if (autoPush) { let readme = await fsp.readFile('src/bin/plugins/lib/README.md', {encoding: 'utf8', flag: 'r'}); readme = readme.replace(/\[plugin_name\]/g, pluginName); - if (repository) { - const org = repository.split('/')[3]; - const name = repository.split('/')[4]; - readme = readme.replace(/\[org_name\]/g, org); - readme = readme.replace(/\[repo_url\]/g, name); - await fsp.writeFile(`${pluginPath}/README.md`, readme); - } else { - console.warn('Unable to find repository in package.json, aborting.'); - } + await fsp.writeFile(`${pluginPath}/README.md`, readme); } } diff --git a/src/bin/plugins/lib/README.md b/src/bin/plugins/lib/README.md index e17a23ed1..e7bdef01d 100755 --- a/src/bin/plugins/lib/README.md +++ b/src/bin/plugins/lib/README.md @@ -1,5 +1,3 @@ -[![Travis (.com)](https://api.travis-ci.com/[org_name]/[repo_url].svg?branch=develop)](https://travis-ci.com/github/[org_name]/[repo_url]) - # My awesome plugin README example Explain what your plugin does and who it's useful for.