Count plugins (#839)
* add plugins counting to README * add total.svg to dist branch * test * change to LNReader
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
# LNReader Plugins
|
# LNReader Plugins
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<img alt="GitHub issues by-label" src="https://img.shields.io/github/issues/lnreader/lnreader-sources/Source%20Request?color=success&label=source%20requests">
|
<img alt="LNReader plugins counting" src="https://raw.githubusercontent.com/LNReader/lnreader-sources/dist/total.svg">
|
||||||
|
<img alt="GitHub issues by-label" src="https://img.shields.io/github/issues/lnreader/lnreader-sources/Source%20Request?color=success&label=source%20requests">
|
||||||
<img alt="GitHub issues by-label" src="https://img.shields.io/github/issues/lnreader/lnreader-sources/Bug?color=red&label=bugs">
|
<img alt="GitHub issues by-label" src="https://img.shields.io/github/issues/lnreader/lnreader-sources/Bug?color=red&label=bugs">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ rm -r -fo .js
|
|||||||
npm run clearMultisrc
|
npm run clearMultisrc
|
||||||
npm run generate
|
npm run generate
|
||||||
npm run json
|
npm run json
|
||||||
git add -f icons .dist .js/plugins
|
git add -f icons .dist .js/plugins total.svg
|
||||||
git commit -m "Host plugins"
|
git commit -m "Host plugins"
|
||||||
git push -f origin $dist
|
git push -f origin $dist
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ rm -rf .js
|
|||||||
npm run clearMultisrc
|
npm run clearMultisrc
|
||||||
npm run generate
|
npm run generate
|
||||||
npm run json
|
npm run json
|
||||||
git add -f icons .dist .js/plugins
|
git add -f icons .dist .js/plugins total.svg
|
||||||
git commit -m "Host plugins"
|
git commit -m "Host plugins"
|
||||||
git push -f origin $dist
|
git push -f origin $dist
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ if (!fs.existsSync(path.join(outRoot, ".dist"))) {
|
|||||||
const jsonPath = path.join(outRoot, ".dist", "plugins.json");
|
const jsonPath = path.join(outRoot, ".dist", "plugins.json");
|
||||||
const jsonMinPath = path.join(outRoot, ".dist", "plugins.min.json");
|
const jsonMinPath = path.join(outRoot, ".dist", "plugins.min.json");
|
||||||
const pluginSet = new Set();
|
const pluginSet = new Set();
|
||||||
|
let totalPlugins = 0;
|
||||||
|
|
||||||
for (let language in languages) {
|
for (let language in languages) {
|
||||||
// language with English name
|
// language with English name
|
||||||
@@ -80,6 +81,7 @@ for (let language in languages) {
|
|||||||
pluginSet.add(id);
|
pluginSet.add(id);
|
||||||
}
|
}
|
||||||
json[language].push(info);
|
json[language].push(info);
|
||||||
|
totalPlugins += 1;
|
||||||
console.log(name, "✅");
|
console.log(name, "✅");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -88,6 +90,13 @@ for (let lang in json) json[lang].sort((a, b) => a.id.localeCompare(b.id));
|
|||||||
|
|
||||||
fs.writeFileSync(jsonMinPath, JSON.stringify(json));
|
fs.writeFileSync(jsonMinPath, JSON.stringify(json));
|
||||||
fs.writeFileSync(jsonPath, JSON.stringify(json, null, "\t"));
|
fs.writeFileSync(jsonPath, JSON.stringify(json, null, "\t"));
|
||||||
|
if(CURRENT_BRANCH === 'dist'){
|
||||||
|
fetch(`https://img.shields.io/badge/Plugins-${totalPlugins}-blue`)
|
||||||
|
.then(res => res.text())
|
||||||
|
.then(data => {
|
||||||
|
fs.writeFileSync('total.svg', data, {encoding: 'utf-8'});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// check for broken plugins
|
// check for broken plugins
|
||||||
for (let language in languages) {
|
for (let language in languages) {
|
||||||
|
|||||||
Reference in New Issue
Block a user