|
|
|
@ -88,13 +88,11 @@ export async function getExecNamePosPairs() { |
|
|
|
|
return formattedExec; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export async function getExec(execNamePosPair: string[], convert = true) { |
|
|
|
|
export async function getExec(name: string, pos: string, convert = true) { |
|
|
|
|
let content, metadata; |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
const raw = await readFile( |
|
|
|
|
path.join(EXECS_PATH, `${execNamePosPair[0]}${fileType}`) |
|
|
|
|
); |
|
|
|
|
const raw = await readFile(path.join(EXECS_PATH, `${name}${fileType}`)); |
|
|
|
|
({ content, data: metadata } = matter(raw)); |
|
|
|
|
|
|
|
|
|
const image = |
|
|
|
@ -107,13 +105,11 @@ export async function getExec(execNamePosPair: string[], convert = true) { |
|
|
|
|
}; |
|
|
|
|
} catch (err) { |
|
|
|
|
const firstName = |
|
|
|
|
execNamePosPair[0].split("-")[0][0].toUpperCase() + |
|
|
|
|
execNamePosPair[0].split("-")[0].slice(1); |
|
|
|
|
name.split("-")[0][0].toUpperCase() + name.split("-")[0].slice(1); |
|
|
|
|
const lastName = |
|
|
|
|
execNamePosPair[0].split("-")[1][0].toUpperCase() + |
|
|
|
|
execNamePosPair[0].split("-")[1].slice(1); |
|
|
|
|
name.split("-")[1][0].toUpperCase() + name.split("-")[1].slice(1); |
|
|
|
|
|
|
|
|
|
const posName = execPositions[execNamePosPair[1]]; |
|
|
|
|
const posName = execPositions[pos]; |
|
|
|
|
({ content, metadata } = { |
|
|
|
|
content: "Coming soon!", |
|
|
|
|
metadata: { |
|
|
|
|