diff --git a/scripts/json_plugins.ts b/scripts/json_plugins.ts index 806d02cc1..60e01c3c7 100644 --- a/scripts/json_plugins.ts +++ b/scripts/json_plugins.ts @@ -87,14 +87,13 @@ json.sort((a, b) => { fs.writeFileSync(jsonMinPath, JSON.stringify(json)); fs.writeFileSync(jsonPath, JSON.stringify(json, null, '\t')); -fetch(`https://img.shields.io/badge/Plugins-${totalPlugins}-blue`) - .then(res => res.text()) - .then(data => { - fs.writeFileSync('total.svg', data, { encoding: 'utf-8' }); - }) - .catch(error => { - fs.writeFileSync('total.svg', '', { encoding: 'utf-8' }); - }); +const svgContent = fs.readFileSync(path.join(root, 'total.template.svg'), { + encoding: 'utf-8', +}); +fs.writeFileSync( + path.join(root, 'total.svg'), + svgContent.replace(/--replacement--/g, `Plugins: ${totalPlugins}`), +); // check for broken plugins for (let language in languages) { diff --git a/total.template.svg b/total.template.svg new file mode 100644 index 000000000..1b26478bd --- /dev/null +++ b/total.template.svg @@ -0,0 +1 @@ +--replacement--Plugins161 \ No newline at end of file