aboutsummaryrefslogtreecommitdiff
path: root/update.js
diff options
context:
space:
mode:
authorJoel Kronqvist <work.joelkronqvist@gmail.com>2022-10-15 20:05:32 +0300
committerJoel Kronqvist <work.joelkronqvist@gmail.com>2022-10-15 20:05:32 +0300
commitb2925ef2579050c484a552f2cd9c0ffed11fb1e9 (patch)
treecf7708162afe815ef855e8af5e9a1012d2587ff6 /update.js
parent98a7a9947828514372d873b88fcdcdf44a358dd3 (diff)
downloadLYLLRuoka-b2925ef2579050c484a552f2cd9c0ffed11fb1e9.tar.gz
LYLLRuoka-b2925ef2579050c484a552f2cd9c0ffed11fb1e9.zip
Bug fixes & started setup.sh
Diffstat (limited to 'update.js')
-rw-r--r--update.js12
1 files changed, 5 insertions, 7 deletions
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
+*/