Test getExec function

pull/403/head
Rebecca-Chou 10 months ago
parent 608f6342da
commit 6ad38d1971
  1. 37
      lib/team.ts

@ -92,7 +92,7 @@ export async function getExec(fileName: string, convert = true) {
let content, metadata;
try {
// try {
const raw = await readFile(path.join(EXECS_PATH, `${fileName}${fileType}`));
({ content, data: metadata } = matter(raw));
@ -103,23 +103,24 @@ export async function getExec(fileName: string, convert = true) {
return {
content: convert ? await serialize(content) : content,
metadata: { ...metadata, image } as Metadata,
};
} catch (err) {
({ content, metadata } = {
content: "Coming soon!",
metadata: {
name: `${firstName} ${lastName}`,
role: `${pos}`,
},
});
const image = await getMemberImagePath(metadata.name);
return {
content: convert ? await serialize(content) : content,
metadata: { ...metadata, image } as Metadata,
};
}
// };
// } catch (err) {
// console.log(err);
// ({ content, metadata } = {
// content: "Coming soon!",
// metadata: {
// name: `${firstName} ${lastName}`,
// role: `${pos}`,
// },
// });
// const image = await getMemberImagePath(metadata.name);
// return {
// content: convert ? await serialize(content) : content,
// metadata: { ...metadata, image } as Metadata,
// };
// }
}
async function getImage(imgPath: string) {

Loading…
Cancel
Save