不要怂,就是干,撸起袖子干!

Commit c3b6e629 by Ricardo Graça

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

1 parent 5fa778ea
Showing with 4 additions and 1 deletions
...@@ -4,3 +4,4 @@ test*.js ...@@ -4,3 +4,4 @@ test*.js
.DS_STORE .DS_STORE
node_modules node_modules
npm-debug.log npm-debug.log
*~
...@@ -93,7 +93,9 @@ module.exports = (function() { ...@@ -93,7 +93,9 @@ module.exports = (function() {
callback && callback(null, result) 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) { var migrations = migrationFiles.map(function(file) {
return new Migration(self, self.options.path + '/' + file) return new Migration(self, self.options.path + '/' + file)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!