aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarsVomMars2020-10-10 13:18:17 +0200
committerLarsVomMars2020-10-10 13:18:17 +0200
commit5ad5d0968b8f7948bf076567b5f42f9a8bdb3cc0 (patch)
tree08e193c565e52f490abb5f12c8bad83df16e6cf3
parent3b16ab7ebee3d432a66d7966a2e8a6c2541f3912 (diff)
parentd99c8fd5281d32b6f1ef5174e403f0b0ee9ad522 (diff)
Merge branch 'profile' of github.com:marvinborner/abizeugs into profile
-rw-r--r--db.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/db.js b/db.js
index 7cab0fa..31cf795 100644
--- a/db.js
+++ b/db.js
@@ -77,6 +77,15 @@ class DB {
});
});
+ fs.readFile(__dirname + "/profile.txt", "utf8", (err, data) => {
+ if (err) throw err;
+
+ const questions = data.split("\n");
+ questions.forEach((question) => {
+ if (question) this.query("INSERT INTO profile_questions (question) VALUE (?)", [question]);
+ });
+ });
+
const classes = data.split("--");
const userPasswords = {};
console.log("Generating users");