Exit the process on successfull CLI commands

Fixes #3256
This commit is contained in:
rijkvanzanten
2020-12-07 18:52:17 -05:00
parent f2cc4ed66c
commit a5e8da9677
6 changed files with 16 additions and 9 deletions

View File

@@ -8,10 +8,11 @@ export default async function start() {
try {
await installSeeds(database);
await runMigrations(database, 'latest');
database.destroy();
process.exit(0);
} catch (err) {
console.log(err);
process.exit(1);
} finally {
database.destroy();
process.exit(1);
}
}

View File

@@ -17,8 +17,8 @@ export default async function migrate(direction: 'latest' | 'up' | 'down') {
}
} catch (err) {
console.log(err);
process.exit(1);
} finally {
database.destroy();
process.exit(1);
}
}