Permalink
Browse files

Migrations: only load files ending in .js from the migrations dir.

  • Loading branch information...
1 parent 5fa778e commit c3b6e62935ef15ae4b4a28c72d462e7d09cbda6f @ricardograca ricardograca committed Jan 9, 2013
Showing with 4 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +3 −1 lib/migrator.js
View
@@ -4,3 +4,4 @@ test*.js
.DS_STORE
node_modules
npm-debug.log
+*~
View
@@ -93,7 +93,9 @@ module.exports = (function() {
callback && callback(null, result)
}
- var migrationFiles = fs.readdirSync(this.options.path)
+ var migrationFiles = fs.readdirSync(this.options.path).filter(function(file) {
+ return /\.js$/.test(file)
+ })
var migrations = migrationFiles.map(function(file) {
return new Migration(self, self.options.path + '/' + file)

0 comments on commit c3b6e62

Please sign in to comment.