Skip to content

Commit

Permalink
fixed broken list command
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleytodd committed Sep 23, 2017
1 parent e57b97d commit 4ea4420
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions bin/migrate-list
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

var program = require('commander')
var path = require('path')
var moment = require('moment')
var dateFormat = require('dateformat')
var minimatch = require('minimatch')
var migrate = require('../')
var log = require('../lib/log')
Expand All @@ -17,6 +17,7 @@ program
.option('-c, --chdir <dir>', 'Change the working directory', process.cwd())
.option('-f, --state-file <path>', 'Set path to state file', '.migrate')
.option('-s, --store <store>', 'Set the migrations store', path.join(__dirname, '..', 'lib', 'file-store'))
.option('-d, --date-format [format]', 'Set a date format to use', 'YYYY-MM-DD')
.option('--migrations-dir <dir>', 'Change the migrations directory name', 'migrations')
.option('--matches <glob>', 'A glob pattern to filter migration files', '*')
.option('--compiler <ext:module>', 'Use the given module to compile files')
Expand Down Expand Up @@ -56,6 +57,6 @@ migrate.load({
}

set.migrations.forEach(function (migration) {
log(migration.title + (migration.timestamp ? ' [' + moment(migration.timestamp).format('YYYY-MM-DD') + ']' : ' [not run]'), migration.description || '<No Description>')
log(migration.title + (migration.timestamp ? ' [' + dateFormat(migration.timestamp, dateFormat) + ']' : ' [not run]'), migration.description || '<No Description>')
})
})
2 changes: 1 addition & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe('$ migrate', function () {
it('should list available migrations', function (done) {
list([], function (err, out, code) {
assert(!err)
assert.equal(code, 0)
assert.equal(code, 0, out)
assert(out.indexOf('1-one.js') !== -1)
assert(out.indexOf('2-two.js') !== -1)
done()
Expand Down

0 comments on commit 4ea4420

Please sign in to comment.