Skip to content

Commit

Permalink
Pass in migration mode, handle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wswoodruff committed Sep 14, 2017
1 parent 9d1c685 commit 94bb717
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,17 @@ internals.initialize = (server, next) => {

// Maybe run schwifty-migration to generate migration file

if (collector.makeMigrationMode === true) {
SchwiftyMigration.genMigrationFile({ migrationGroups }, () => {
if (collector.makeMigrationMode !== 'undefined') {

SchwiftyMigration.genMigrationFile({
migrationGroups,
mode: collector.makeMigrationMode
}, (err) => {

if (err) {
console.error(err);
process.exit(1);
}

process.exit(0);
});
Expand Down

0 comments on commit 94bb717

Please sign in to comment.