Skip to content

Commit

Permalink
filter out files which don't start with a number or have an exported id
Browse files Browse the repository at this point in the history
  • Loading branch information
terencehonles committed Sep 28, 2017
1 parent 61f9c52 commit 1ea6924
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mongodb-migrations.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,13 @@ class Migrator
n = null
return { number: n, name: f }
.filter (f) -> !!f.name
.sort (f1, f2) -> f1.number - f2.number
.map (f) ->
fileName = path.join dir, f.name
if fileName.match /\.coffee$/
require('coffee-script/register')
return { number: f.number, module: require(fileName) }
.filter (f) -> f.module.id?
.sort (f1, f2) -> f1.number - f2.number
cb null, files

runFromDir: (dir, done, progress) ->
Expand Down

0 comments on commit 1ea6924

Please sign in to comment.