mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-10 13:18:25 +00:00
docs: updated guideline icons (#2676)
* docs: updated guideline icons * Update docs/images/1px-border-radius.svg * Update docs/images/1px-border-radius.svg * Update docs/images/1px-padding.svg * Update docs/images/24px-24px.svg * Update docs/images/2px-element-spacing.svg * Update docs/images/2px-stroke.svg
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import path from 'path';
|
||||
import { readdirSync, readFileSync, writeFileSync } from 'fs';
|
||||
|
||||
for (const file of readdirSync(path.join(import.meta.dirname, '../docs/images'))) {
|
||||
if (!file.endsWith('.svg')) continue;
|
||||
const fileName = path.join(import.meta.dirname, '../docs/images', file);
|
||||
const oldFileContent = readFileSync(fileName, 'utf8');
|
||||
const newFileContent = oldFileContent
|
||||
.split('</g>')
|
||||
.map((val) =>
|
||||
val.replace(
|
||||
/(<g id="embed-lucide-([^"]*).*>)(.|\n)*/gm,
|
||||
(_, groupOpeningTag, iconName) =>
|
||||
[
|
||||
groupOpeningTag,
|
||||
...readFileSync(path.join(import.meta.dirname, `../icons/${iconName}.svg`), 'utf8')
|
||||
.replace(/(<svg)([^>]|\n)*>|<\/svg>/g, '')
|
||||
.split('\n'),
|
||||
]
|
||||
.map((val) => val.trimEnd())
|
||||
.filter(Boolean)
|
||||
.join('\n') + '\n',
|
||||
),
|
||||
)
|
||||
.join('</g>');
|
||||
if (oldFileContent !== newFileContent) {
|
||||
console.log(`Updating ${fileName}`);
|
||||
writeFileSync(fileName, newFileContent);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user