fix cart names
This commit is contained in:
parent
943b11869c
commit
c93e55fe60
@ -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,
|
||||
|
@ -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)));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user