This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import fs from "fs"
|
||||
import fs from "fs/promises"
|
||||
|
||||
const CLASSES: string[] = [
|
||||
"A1a", "A1b", "A1c", "C1a", "C1b", "C1c", "A2", "C2a", "C2b", "C2c", "E2", "C3a", "C3b", "C3c", "E3"
|
||||
@@ -45,7 +45,7 @@ interface ScheduleData {
|
||||
status: { lastUpdated: string };
|
||||
}
|
||||
|
||||
export default function generateArchivedV1_V2(): void {
|
||||
export default async function generateArchivedV1_V2() {
|
||||
const dates = getCurrentWeekMondayToFriday();
|
||||
const currentDate = new Date();
|
||||
const lastUpdated = currentDate.getHours().toString().padStart(2, "0") + ":" + currentDate.getMinutes().toString().padStart(2, "0");
|
||||
@@ -73,6 +73,8 @@ export default function generateArchivedV1_V2(): void {
|
||||
data.schedule.push(d);
|
||||
}
|
||||
|
||||
fs.writeFileSync("volume/db/v1.json", JSON.stringify(data, null, 2));
|
||||
fs.writeFileSync("volume/db/v2.json", JSON.stringify(data, null, 2));
|
||||
await Promise.all([
|
||||
fs.writeFile("volume/db/v1.json", JSON.stringify(data, null, 2)),
|
||||
fs.writeFile("volume/db/v2.json", JSON.stringify(data, null, 2)),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user