fix cart names

This commit is contained in:
dylan 2024-03-31 14:26:16 -07:00
parent 943b11869c
commit c93e55fe60
2 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ const handler = async ({payload}: FirRouteInput<typeof payloadT>) => {
auth: token,
});
const carts = await getCarts(manifest.carts.map((name: string) => path.join(repoPath, name)));
const carts = await getCarts(repoPath, manifest.carts);
console.log({
manifest,

View File

@ -32,13 +32,13 @@ const getRom = async (inputFile: string) => {
return JSON.parse(match[1]) as number[]
}
const getCart = async (inputFile: string) => {
const getCart = async (baseDir: string, inputFile: string) => {
return {
name: inputFile,
rom: await getRom(inputFile),
rom: await getRom(path.join(baseDir, inputFile)),
}
}
export const getCarts = async (inputFiles: string[]) => {
return await Promise.all(inputFiles.map(getCart));
export const getCarts = async (baseDir: string, inputFiles: string[]) => {
return await Promise.all(inputFiles.map(inputFile => getCart(baseDir, inputFile)));
}