Florian Bouillon 557dad7e33
Updated Compiler to be quicker
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2020-05-05 11:46:36 +02:00

29 lines
615 B
TypeScript

import { getAllCards2 } from "../util"
import Card from "@tcgdex/sdk/interfaces/Card"
import { promises as fs} from "fs"
import { illustratorsFile, fetchIllustrators } from "../illustratorUtil"
const dbFile = illustratorsFile
export default async () => {
const db = await fetchIllustrators()
const list = getAllCards2()
for (let i of list) {
i = i.replace("./", "../../")
const card: Card = require(i).default
if (!card.illustrator) continue
const illustrator = card.illustrator
if (!db.includes(illustrator)) {
db.push(illustrator)
}
}
await fs.writeFile(dbFile, JSON.stringify(db))
}