Skip to content

Commit

Permalink
Format with prettier-standard
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Dec 20, 2017
1 parent 7e442a3 commit 471f067
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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':
Expand Down

0 comments on commit 471f067

Please sign in to comment.