Florian Bouillon b5ce0c9b93
Updated compiler and trying to make ci work again
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2020-03-16 22:40:00 +01:00

31 lines
621 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
const btsp = 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))
}
btsp()