Updated illustrators

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
2020-03-10 14:39:23 +01:00
parent 552e4b49fa
commit 55c33bb2a3
5 changed files with 103 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
import { getAllCards2 } from "../util"
import Card from "../../db/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()