6ba2976e1b5da7d1f3fd5819d35386e165f78682 diff --git a/src/games.ts b/src/games.ts index 5417fd4894304f1651233af42dcabb8936e82757..944cf662e1fbb113843a98026d6f5809c6fde04a 100644 --- a/src/games.ts +++ b/src/games.ts @@ -8,6 +8,10 @@ export interface Game { } export async function loadGame(id: string): Promise { + const file = Bun.file(`./content/games/${id}/spec.ts`); + if (!(await file.exists())) { + throw new Error(`unknown game: ${id}`); + } const mod = await import(`../content/games/${id}/spec.ts`); return mod.spec as Game; }