2019-05-25 11:36:19 +00:00
|
|
|
import path from 'path'
|
|
|
|
import fse from 'fs-extra'
|
2019-06-01 06:37:20 +00:00
|
|
|
import { loadBadgeMeta } from '../libs/badge-list'
|
2023-03-18 02:34:07 +00:00
|
|
|
import BadgeList2 from '../libs/badge-list2'
|
2019-05-25 11:36:19 +00:00
|
|
|
|
|
|
|
const rel = (...args) => path.resolve(__dirname, ...args)
|
|
|
|
|
2022-12-31 11:44:19 +00:00
|
|
|
;(async function main () {
|
2023-03-18 09:58:22 +00:00
|
|
|
// old list
|
2019-06-01 06:37:20 +00:00
|
|
|
const badgeMeta = await loadBadgeMeta()
|
2022-12-31 11:44:19 +00:00
|
|
|
await fse.outputJson(rel('../public/.meta/badges.json'), badgeMeta, {
|
|
|
|
spaces: 2
|
|
|
|
})
|
2023-03-18 02:34:07 +00:00
|
|
|
|
2023-03-18 09:58:22 +00:00
|
|
|
// new list
|
2023-03-18 02:34:07 +00:00
|
|
|
await fse.outputJson(rel('../public/.meta/badge-list.json'), BadgeList2, {
|
|
|
|
spaces: 2
|
|
|
|
})
|
2022-12-31 11:44:19 +00:00
|
|
|
})()
|
2019-05-25 11:36:19 +00:00
|
|
|
|
|
|
|
process.on('unhandledRejection', console.error)
|