1
0
mirror of https://github.com/tabler/tabler-icons.git synced 2025-01-17 20:58:34 +01:00
tabler-icons/.build/changelog-commit.mjs
2023-01-22 00:02:47 +01:00

25 lines
778 B
JavaScript

import cp from 'child_process'
import { printChangelog } from './helpers.mjs'
cp.exec('git status', function(err, ret) {
let newIcons = [], modifiedIcons = [], renamedIcons = []
ret.replace(/new file:\s+src\/_icons\/([a-z0-9-]+)\.svg/g, function(m, fileName) {
newIcons.push(fileName)
})
ret.replace(/modified:\s+src\/_icons\/([a-z0-9-]+)\.svg/g, function(m, fileName) {
modifiedIcons.push(fileName)
})
ret.replace(/renamed:\s+src\/_icons\/([a-z0-9-]+).svg -> src\/_icons\/([a-z0-9-]+).svg/g, function(m, fileNameBefore, fileNameAfter) {
renamedIcons.push([fileNameBefore, fileNameAfter])
})
modifiedIcons = modifiedIcons.filter(function(el) {
return newIcons.indexOf(el) < 0
})
printChangelog(newIcons, modifiedIcons, renamedIcons)
})