Added database check.
This commit is contained in:
@@ -2,7 +2,7 @@ require('dotenv').config();
|
||||
const fse = require('fs-extra');
|
||||
const path = require('path');
|
||||
|
||||
function getDatabase() {
|
||||
function getDatabaseType() {
|
||||
const type =
|
||||
process.env.DATABASE_TYPE ||
|
||||
(process.env.DATABASE_URL && process.env.DATABASE_URL.split(':')[0]);
|
||||
@@ -14,7 +14,7 @@ function getDatabase() {
|
||||
return type;
|
||||
}
|
||||
|
||||
const databaseType = getDatabase();
|
||||
const databaseType = getDatabaseType();
|
||||
|
||||
if (!databaseType || !['mysql', 'postgresql'].includes(databaseType)) {
|
||||
throw new Error('Missing or invalid database');
|
||||
|
||||
Reference in New Issue
Block a user