Skip to content

Commit

Permalink
fix f123, add script to validate card images
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Jun 23, 2024
1 parent cc3fc41 commit b347c31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion content/card-data/arcs/en-US/blightedreach.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@
Then, they may add 1 resource they have to the Imperial Trust.
When a player **declares** the Sponsored ambition, they must take 1 resource from the Imperial Trust, gain the Power for second place on the placed ambition marker, and return the Sponsored token to the First Regent tile. If they are an Outlaw, they become a Regent.
image: B123
image: F123
name: Imperial Sponsor
tags:
- Blighted Reach
Expand Down
12 changes: 12 additions & 0 deletions scripts/validate-cards.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const path = require('node:path');
const fs = require('fs-extra');
const { omit } = require('lodash');

Expand All @@ -19,6 +20,17 @@ allCards.forEach((card, index) => {
process.exit(1);
}

const fixedImage = decodeURIComponent(path.basename(card.image, '.webp'));
const imagePath = `${process.cwd()}/content/card-images/${card.game}/${
card.locale
}/${fixedImage}.png`;
if (!fs.existsSync(imagePath)) {
console.error(
`Card ${card.id} references an invalid image "${imagePath}".`,
);
process.exit(1);
}

if (!card.game) {
console.error(`Card ${card.id} does not have a game.`);
process.exit(1);
Expand Down

0 comments on commit b347c31

Please sign in to comment.