Florian Bouillon ef866401a4
Moved files to link with the SDK
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2020-03-11 11:21:40 +01:00

32 lines
638 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
console.log(i)
const illustrator = card.illustrator
if (!db.includes(illustrator)) {
db.push(illustrator)
}
}
await fs.writeFile(dbFile, JSON.stringify(db))
}
btsp()