From f386d5cc4bbfd09c46935e98d33081c74c1f8f8a Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 18 Jan 2013 11:17:34 -0800 Subject: [PATCH] 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. --- src/app/atom-package.coffee | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/app/atom-package.coffee b/src/app/atom-package.coffee index 7d66ab6a7..e86678a37 100644 --- a/src/app/atom-package.coffee +++ b/src/app/atom-package.coffee @@ -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)