Skip to content

Commit

Permalink
Add force-exit flag
Browse files Browse the repository at this point in the history
  • Loading branch information
codeaholics committed Jun 3, 2013
1 parent bdf165c commit 99ab688
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/db-migrate
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ process.on('uncaughtException', function(err) {
var argv = optimist
.default({
verbose: false,
"force-exit": false,
config: process.cwd() + '/database.json',
'migrations-dir': process.cwd() + '/migrations' })
.usage('Usage: db-migrate [up|down|create] migrationName [options]')
Expand All @@ -38,6 +39,9 @@ var argv = optimist
.describe('dry-run', "Prints the SQL but doesn't run it.")
.boolean('dry-run')

.describe('force-exit', 'Forcibly exit the migration process on completion.')
.boolean('force-exit')

.describe('verbose', 'Verbose mode.')
.alias('v', 'verbose')
.boolean('v')
Expand Down Expand Up @@ -179,3 +183,8 @@ function run() {
}

run();

if (argv['force-exit']) {
log.verbose("Forcing exit");
process.exit(0);
}

0 comments on commit 99ab688

Please sign in to comment.