mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Ported CLI from commander to yargs because yargs suits our large CLI better and is easier to develop with. Split commands into separate files since the file was getting annoyingly long.
This commit is contained in:
parent
72a16ed2ff
commit
cc736ba0ac
35 changed files with 2006 additions and 1538 deletions
22
lib/cli/migrate/index.js
Normal file
22
lib/cli/migrate/index.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
module.exports.command = 'migrate'
|
||||
|
||||
module.exports.describe = 'Migrates the database to the latest version.'
|
||||
|
||||
module.exports.builder = function(yargs) {
|
||||
return yargs
|
||||
}
|
||||
|
||||
module.exports.handler = function() {
|
||||
var logger = require('../../util/logger')
|
||||
var log = logger.createLogger('cli:migrate')
|
||||
var db = require('../../db')
|
||||
|
||||
return db.setup()
|
||||
.then(function() {
|
||||
process.exit(0)
|
||||
})
|
||||
.catch(function(err) {
|
||||
log.fatal('Migration had an error:', err.stack)
|
||||
process.exit(1)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue