aboutsummaryrefslogtreecommitdiff
path: root/update.js
diff options
context:
space:
mode:
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
+*/