mirror of
https://github.com/tcgdex/compiler.git
synced 2025-04-22 10:42:09 +00:00
Sorted Sets by release date
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
parent
cee4181627
commit
6cb861d16e
@ -11,7 +11,7 @@ const endpoint = getBaseFolder(lang, "sets")
|
|||||||
|
|
||||||
const bootstrap = async () => {
|
const bootstrap = async () => {
|
||||||
const list = await getAllSets()
|
const list = await getAllSets()
|
||||||
const items: Array<SetSimple> = []
|
let items: Array<Set> = []
|
||||||
for (let el of list) {
|
for (let el of list) {
|
||||||
el = el.replace("./", "../../")
|
el = el.replace("./", "../../")
|
||||||
const set: Set = require(el).default
|
const set: Set = require(el).default
|
||||||
@ -19,13 +19,17 @@ const bootstrap = async () => {
|
|||||||
console.log(el)
|
console.log(el)
|
||||||
if (!isSetAvailable(set, lang)) continue
|
if (!isSetAvailable(set, lang)) continue
|
||||||
items.push(
|
items.push(
|
||||||
setToSetSimple(set, lang)
|
set
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
items = items.sort((a, b) => a.releaseDate > b.releaseDate ? 1 : -1)
|
||||||
|
|
||||||
|
const tmp: Array<SetSimple> = items.map((el) => setToSetSimple(el, lang))
|
||||||
|
|
||||||
const cardList: SetList = {
|
const cardList: SetList = {
|
||||||
count: items.length,
|
count: tmp.length,
|
||||||
list: items
|
list: tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
await fs.mkdir(`${endpoint}`, {recursive: true})
|
await fs.mkdir(`${endpoint}`, {recursive: true})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user