mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user