Only auto-load .cson and .json keymap files

This now prevents files such as .DS_Store from being loaded as a
keymap where previously all paths were loaded regardless of extension.

Closes #205
This commit is contained in:
Kevin Sawicki
2013-01-31 12:01:02 -08:00
parent e24859cc23
commit 379a4a4d8d
6 changed files with 24 additions and 12 deletions

View File

@@ -59,11 +59,16 @@ module.exports =
# Returns an array with all the names of files contained
# in the directory path.
list: (rootPath) ->
list: (rootPath, extensions) ->
paths = []
onPath = (path) =>
paths.push(@join(rootPath, path))
false
if extensions
onPath = (path) =>
paths.push(@join(rootPath, path)) if _.contains(extensions, @extension(path))
false
else
onPath = (path) =>
paths.push(@join(rootPath, path))
false
@traverseTree(rootPath, onPath, onPath)
paths