Skip to content

Commit

Permalink
fix: update svg locally
Browse files Browse the repository at this point in the history
  • Loading branch information
nyagami committed Jun 6, 2024
1 parent 8a707ff commit ad78bad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
15 changes: 7 additions & 8 deletions scripts/json_plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions total.template.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ad78bad

Please sign in to comment.