From b2925ef2579050c484a552f2cd9c0ffed11fb1e9 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sat, 15 Oct 2022 20:05:32 +0300 Subject: Bug fixes & started setup.sh --- update.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'update.js') diff --git a/update.js b/update.js index a78b57a..c66a97b 100644 --- a/update.js +++ b/update.js @@ -6,14 +6,12 @@ const parse = require("./dbparse.js"); // Run this if you want to build the database from text files async function buildDB(dbcredentials, shiftPath, ...classfiles) { - let shiftCont = await openFile(shiftPath); const DB = new database.Database(JSON.parse(dbcredentials)); - shiftCont = shiftCont.toString("utf-8").replaceAll("\r", ""); // \r because of the \r\n newline on windows which creates problems + let shiftCont = await openFile(shiftPath); + shiftCont = shiftCont.toString("utf-8").replaceAll("\r", ""); // \r because of the \r\n newline on windows which may create problems - await Promise.all([ - parseClasses(DB, ...classfiles), - parse.build(shiftCont, DB) - ]); + await parseClasses(DB, ...classfiles), + await parse.build(shiftCont, DB) return 0; } @@ -23,4 +21,4 @@ exports.update = buildDB; const openFile = require("./Functions/open.js").file; const dbcredentials = await openFile("../dblogin.txt"); await updateDB.update(dbcredentials, "./shifts.txt", "./Kurssitarjottimet/2016Classes.txt", "./Kurssitarjottimet/NewClasses.txt"); -*/ \ No newline at end of file +*/ -- cgit v1.2.3