CLI has to fail when configuration not present, fix #284

This commit is contained in:
lesion 2023-07-08 22:43:12 +02:00
parent 8eb43ac7b5
commit 36a55ba6c5
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 5 additions and 1 deletions

View file

@ -1,6 +1,10 @@
let db
function _initializeDB () {
const config = require('../config')
if (config.status !== 'CONFIGURED') {
console.error(`> Cannot run CLI before setup (are you in the correct path?)`)
process.exit(1)
}
config.log_level = 'error'
db = require('../api/models/index')
return db.initialize()

View file

@ -44,7 +44,7 @@ let config = {
}
} else {
config.status = 'SETUP'
console.info('> Configuration file does not exists, running setup..')
console.info('> Configuration file does not exists...')
}
}
}