CLI has to fail when configuration not present, fix #284
This commit is contained in:
parent
8eb43ac7b5
commit
36a55ba6c5
2 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||
|
|
|
@ -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...')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue