1
0
mirror of https://github.com/tabler/tabler-icons.git synced 2025-09-02 10:24:07 +02:00

import tags fix

This commit is contained in:
codecalm
2024-11-22 14:47:35 +01:00
parent e54656d27e
commit 28acdaff7f

View File

@@ -8,7 +8,7 @@ const data = JSON.parse(fs.readFileSync(join(HOME_DIR, 'new/tags.json'), 'utf-8'
for (const [key, tags] of Object.entries(data)) {
const filename = join(HOME_DIR, `src/_icons/${key}.svg`), tagsInline = tags
const filename = join(HOME_DIR, `icons/outline/${key}.svg`), tagsInline = tags
.join(' ')
.toLowerCase()
.split(' ')
@@ -17,10 +17,10 @@ for (const [key, tags] of Object.entries(data)) {
if (key && tags.length) {
let data = fs.readFileSync(filename).toString()
data = data.replace(/(---[\s\S]+?---)/, function (m, headerContent) {
data = data.replace(/(\<\!--[\s\S]+?-->)/, function (m, headerContent) {
headerContent = headerContent.replace(/tags: .*\n/, '')
headerContent = headerContent.replace(/---/, `---\ntags: [${tagsInline}]`)
headerContent = headerContent.replace(/\<\!--/, `<!--\ntags: [${tagsInline}]`)
return headerContent
})