changelog-image.mjs 689 B

123456789101112131415161718192021222324252627
  1. import { generateIconsPreview, getArgvs, getPackageJson, HOME_DIR } from './helpers.mjs'
  2. import * as fs from 'fs'
  3. const argv = getArgvs(),
  4. p = getPackageJson()
  5. const version = argv['new-version'] || `${p.version}`
  6. if (version) {
  7. const icons = JSON.parse(fs.readFileSync(`${HOME_DIR}/tags.json`))
  8. const newIcons = Object
  9. .entries(icons)
  10. .filter(([name, value]) => {
  11. return `${value.version}.0` === version
  12. })
  13. .map(([name, value]) => {
  14. return `./icons/${name}.svg`
  15. })
  16. if (newIcons.length > 0) {
  17. generateIconsPreview(newIcons, `.github/tabler-icons-${version}.svg`, {
  18. columnsCount: 6,
  19. paddingOuter: 24
  20. })
  21. }
  22. }