Permalink
Browse files

Add force-exit flag

  • Loading branch information...
1 parent bdf165c commit 99ab68837f690bf9093803809d970e0c9ebe5918 @codeaholics codeaholics committed Jun 3, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 bin/db-migrate
View
@@ -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]')
@@ -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')
@@ -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.