mirror of
https://github.com/tabler/tabler-icons.git
synced 2025-09-02 18:33:18 +02:00
import tags fix
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
Reference in New Issue
Block a user