diff --git a/src/cli.js b/src/cli.js index 0fee314..5240e29 100755 --- a/src/cli.js +++ b/src/cli.js @@ -177,7 +177,7 @@ async function umzugOptions (command, umzug) { const opts = omitBy({to: cli.flags.to, from: cli.flags.from}, isNil) if (!isNil(cli.flags.step)) { - await applyStepOption(command, umzug, opts, cli.flags.step); + await applyStepOption(command, umzug, opts, cli.flags.step) } return opts @@ -190,9 +190,10 @@ async function applyStepOption (command, umzug, opts, steps) { } // Use the list of pending or executed migrations to determine what would happen without --step - let migrations = command === 'up' - ? await umzug.pending() - : await umzug.executed().then(m => m.reverse()) + let migrations = + command === 'up' + ? await umzug.pending() + : await umzug.executed().then(m => m.reverse()) // Remove migrations prior to the one used in --from // If it isn't in the list, the --from option has no effect @@ -205,7 +206,7 @@ async function applyStepOption (command, umzug, opts, steps) { // If it isn't in the list, we remove everything, causing a 'migration not pending' notice to show if (opts.to) { const limit = migrations.find(m => m.file.startsWith(opts.to)) - migrations = migrations.slice(0, migrations.indexOf(limit) + 1); + migrations = migrations.slice(0, migrations.indexOf(limit) + 1) } // Limit to the number of migrations available @@ -229,7 +230,7 @@ async function main () { const api = createApi(process.stdout, umzug) const command = cli.input[0] - let opts; + let opts switch (command) { case 'list':