acro5piano/kysely-migration-cli

Always log output in `showResults()`

Closed this issue · 3 comments

Thank you for the helpful tool

Do you mind to change the output f the showResults() function to something like the following snippet, so we'll be able to track errors and passed migrations in build output please?

function showResults({ error, results }: MigrationResultSet) {
  if (results) {
    for (const it of results) {
      console.log(`> ${it.status}: ${it.migrationName} (${it.direction})`)
    }
  }
  if (error) {
    console.error(error)
    process.exit(1)
  }
}

@elmeister Thanks for the suggestion. Yes, please create a pull request! The change would be helpful.

PR created, thank you, and once again - ❤️ for the project you made