Call fs.list() without prior call to fs.exists()

fs.list() returns an empty array if calle for a
non-existent or non-directory path.
This commit is contained in:
Kevin Sawicki
2013-01-18 11:17:34 -08:00
parent 43d0c8a2a1
commit f386d5cc4b

View File

@@ -35,10 +35,7 @@ class AtomPackage extends Package
keymaps.map (relativePath) =>
fs.resolve(@keymapsDirPath, relativePath, ['cson', 'json', ''])
else
if fs.exists(@keymapsDirPath)
fs.list(@keymapsDirPath)
else
[]
fs.list(@keymapsDirPath)
loadStylesheets: ->
for stylesheetPath in @getStylesheetPaths()
@@ -46,7 +43,4 @@ class AtomPackage extends Package
getStylesheetPaths: ->
stylesheetDirPath = fs.join(@path, 'stylesheets')
if fs.exists stylesheetDirPath
fs.list stylesheetDirPath
else
[]
fs.list(stylesheetDirPath)