mirror of
https://github.com/atom/atom.git
synced 2026-02-15 00:55:14 -05:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user