moving name out of file, will mirror file system name

This commit is contained in:
2024-12-17 14:09:41 -07:00
parent 068c2b6983
commit c557bbcc28
17 changed files with 127 additions and 96 deletions

View File

@@ -34,8 +34,9 @@ const getAssignment = async (
assignmentName + ".md"
);
const rawFile = (await fs.readFile(filePath, "utf-8")).replace(/\r\n/g, "\n");
return localAssignmentMarkdown.parseMarkdown(rawFile);
return localAssignmentMarkdown.parseMarkdown(rawFile, assignmentName);
};
export const assignmentsFileStorageService = {
getAssignmentNames,
getAssignment,
@@ -72,7 +73,6 @@ export const assignmentsFileStorageService = {
assignmentMarkdownSerializer.toMarkdown(assignment);
console.log(`Saving assignment ${filePath}`);
await fs.writeFile(filePath, assignmentMarkdown);
},
async delete({