badgen.net/tools/gen-examples.ts

22 wiersze
546 B
TypeScript
Czysty Zwykły widok Historia

import path from 'path'
import fse from 'fs-extra'
2019-06-01 06:37:20 +00:00
import { loadBadgeMeta } from '../libs/badge-list'
import BadgeList2 from '../libs/badge-list2'
const rel = (...args) => path.resolve(__dirname, ...args)
;(async function main () {
// old list
2019-06-01 06:37:20 +00:00
const badgeMeta = await loadBadgeMeta()
await fse.outputJson(rel('../public/.meta/badges.json'), badgeMeta, {
spaces: 2
})
// new list
await fse.outputJson(rel('../public/.meta/badge-list.json'), BadgeList2, {
spaces: 2
})
})()
process.on('unhandledRejection', console.error)