fuck
This commit is contained in:
parent
5a99fbb4a7
commit
82a63c538b
@ -4,7 +4,7 @@ import { join } from 'node:path';
|
|||||||
import z from 'zod';
|
import z from 'zod';
|
||||||
import { DataRoot } from './env.js';
|
import { DataRoot } from './env.js';
|
||||||
|
|
||||||
const games_dir = readdirSync('data/games');
|
const games_dir = readdirSync(join(DataRoot, 'games'));
|
||||||
|
|
||||||
const manifest = z.object({
|
const manifest = z.object({
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
@ -19,7 +19,7 @@ const manifest = z.object({
|
|||||||
const manifestCache: Map<string, z.infer<typeof manifest>> = new Map();
|
const manifestCache: Map<string, z.infer<typeof manifest>> = new Map();
|
||||||
|
|
||||||
for (let game of games_dir) {
|
for (let game of games_dir) {
|
||||||
const manifestContent = manifest.parse(JSON.parse(readFileSync('data/games/' + game + '/manifest.json', 'utf-8')));
|
const manifestContent = manifest.parse(JSON.parse(readFileSync(join(DataRoot, 'games', game, 'manifest.json'), 'utf-8')));
|
||||||
manifestCache.set(game, manifestContent);
|
manifestCache.set(game, manifestContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user