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
|
let db
|
||||||
function _initializeDB () {
|
function _initializeDB () {
|
||||||
const config = require('../config')
|
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'
|
config.log_level = 'error'
|
||||||
db = require('../api/models/index')
|
db = require('../api/models/index')
|
||||||
return db.initialize()
|
return db.initialize()
|
||||||
|
|
|
@ -44,7 +44,7 @@ let config = {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
config.status = 'SETUP'
|
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