diff --git a/index.js b/index.js index 6003a02..f6574c1 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ const yaml = require("js-yaml"); const Validator = require("./Validator"); const fs = require("fs"); const path = require("path"); +const { getSchedule } = require("mvhs-schedule"); const filesNeedFixing = []; @@ -57,6 +58,17 @@ for (let key in directory) { continue; } + if (key === "mvhs") { + const scheduleData = getSchedule(); + obj[key] = { + name: directory[key].name, + school: JSON.stringify(yaml.safeLoad(readFile(`./data/${folder}/school.yml`))), + schedule: JSON.stringify(scheduleData.schedule), + periods: JSON.stringify(scheduleData.periods), + }; + continue; + } + obj[key] = { name: directory[key].name, ...loadSchool(folder), diff --git a/package.json b/package.json index 8659bcf..aff625c 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ }, "homepage": "https://github.com/arjunpat/timing-data#readme", "dependencies": { - "js-yaml": "^3.14.2" + "js-yaml": "^3.14.2", + "mvhs-schedule": "^1.0.0" } }