Skip to content

Commit

Permalink
Merge pull request #135 from lmorchard/use-extension-for-migration-li…
Browse files Browse the repository at this point in the history
…st-all

Only use files with the correct extension for migrations
  • Loading branch information
tgriesser committed Dec 12, 2013
2 parents 7e4913b + f2dd5f8 commit e1be421
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/migrate.js
Expand Up @@ -129,7 +129,10 @@ Migrate.prototype = {
return Promise.promisify(fs.readdir, fs)(this.config.directory);
})
.then(function(migrations) {
return migrations.sort();
var ext = this.config.extension;
return _.filter(migrations, function (value) {
return value.indexOf(ext, value.length - ext.length) !== -1;
}).sort();
});
},

Expand Down
1 change: 1 addition & 0 deletions test/integration/migrate/test/random_bad_file.txt
@@ -0,0 +1 @@
This is definitely not a migration.

0 comments on commit e1be421

Please sign in to comment.