feat: author first playable mystery
This commit is contained in:
@@ -3,6 +3,7 @@ import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import pg from 'pg'
|
||||
import type { CaseState } from '../src/types.js'
|
||||
import { importMysteryTemplate } from '../scripts/importMysteryTemplate.js'
|
||||
import { runMigrations } from './migrations.js'
|
||||
|
||||
const { Client } = pg
|
||||
@@ -65,6 +66,8 @@ const saved = await fetch(`${baseUrl}/api/levels/${state.id}?edit=1`, {
|
||||
})
|
||||
if (!saved.ok) throw new Error(`Could not seed browser test level: ${saved.status}`)
|
||||
|
||||
await importMysteryTemplate(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'mysteries', 'glass-harbor', 'mystery.json'), baseUrl)
|
||||
|
||||
let shuttingDown = false
|
||||
async function shutdown(exitCode: number) {
|
||||
if (shuttingDown) return
|
||||
|
||||
Reference in New Issue
Block a user