refacto: compendium rebuild avec dossier Tarot
Les 78 cartes sont rangées dans un dossier 'Tarot' dans le compendium système. Le script generate-tarot-packs crée le dossier puis y place chaque carte.
This commit is contained in:
@@ -27,6 +27,21 @@ async function main() {
|
||||
await fs.unlink(path.join(SRC_DIR, f))
|
||||
}
|
||||
|
||||
// Créer le dossier Tarot dans le compendium
|
||||
const tarotFolderId = "folder_tarot"
|
||||
const folderDoc = {
|
||||
_id: tarotFolderId,
|
||||
_key: `!folders!${tarotFolderId}`,
|
||||
name: "Tarot",
|
||||
type: "Item",
|
||||
sorting: "a",
|
||||
sort: 0,
|
||||
color: "#8b4513",
|
||||
flags: {},
|
||||
}
|
||||
const folderPath = path.join(SRC_DIR, `${tarotFolderId}.json`)
|
||||
await fs.writeFile(folderPath, JSON.stringify(folderDoc, null, 2), "utf-8")
|
||||
|
||||
// Write each card as a single JSON document file
|
||||
for (let i = 0; i < cards.length; i++) {
|
||||
const card = cards[i]
|
||||
@@ -37,7 +52,7 @@ async function main() {
|
||||
name: card.name,
|
||||
type: "tarot",
|
||||
img: "icons/svg/treasure.svg",
|
||||
folder: null,
|
||||
folder: tarotFolderId,
|
||||
sort: (i + 1) * 100000,
|
||||
flags: {},
|
||||
system: {
|
||||
|
||||
Reference in New Issue
Block a user