mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-30 05:04:13 +00:00
New db migration script - multiplatform, fix mariadb migrations
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
const readline = require("readline");
|
||||
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
||||
|
||||
async function ask(question) {
|
||||
return new Promise((resolve, _reject) => {
|
||||
return rl.question(question, (answer) => {
|
||||
resolve(answer);
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
async function askBool(question) {
|
||||
return /y?/i.test(await ask(question));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ask,
|
||||
askBool
|
||||
}
|
||||
Reference in New Issue
Block a user