[improve] do not ask useless info during docker install

This commit is contained in:
les
2019-09-25 19:07:15 +02:00
parent 297e070801
commit be20ac53de
3 changed files with 116 additions and 92 deletions

View File

@@ -5,10 +5,17 @@ const basename = path.basename(__filename)
const config = require('config')
const consola = require('consola')
const db = {}
let sequelize = null
try {
sequelize = new Sequelize(config.db)
} catch(e) {
consola.warn(` ⚠️ Cannot connect to db, check your configuration => ${e}`)
process.exit(-1)
}
const sequelize = new Sequelize(config.db)
sequelize.authenticate().catch(e => {
consola.error('Error connecting to DB: ', String(e))
consola.error('Error connecting to DB: ', String(e))
process.exit(-1)
})