mirror of
https://github.com/tcgdex/compiler.git
synced 2025-04-23 19:12:09 +00:00
31 lines
621 B
TypeScript
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()
|