Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Returns alphabetically sorted paths #4

Merged
merged 5 commits into from Apr 9, 2014
Merged

Returns alphabetically sorted paths #4

merged 5 commits into from Apr 9, 2014

Conversation

AbeEstrada
Copy link
Contributor

Makes listSync() return alphabetically sorted paths (not case-sensitive)

@@ -131,7 +131,10 @@ fsPlus =
paths = fs.readdirSync(rootPath)
paths = fsPlus.filterExtensions(paths, extensions) if extensions
paths = paths.map (childPath) -> path.join(rootPath, childPath)
paths
paths.sort (a, b) ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could just be the shorter a.toLowerCase().localeCompare(b.toLowerCase())

@kevinsawicki
Copy link
Contributor

I think list() should also be updated for consistency, what do you think?

* upstream/master:
  2.0.4
  Order alphabetically
  Add "compiled" python files
@@ -131,7 +131,7 @@ fsPlus =
paths = fs.readdirSync(rootPath)
paths = fsPlus.filterExtensions(paths, extensions) if extensions
paths = paths.map (childPath) -> path.join(rootPath, childPath)
paths
paths.sort (a, b) -> a.toLowerCase().localeCompare(b.toLowerCase())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, maybe this should be done before the paths.map call since the strings will be shorter then and probably quicker to sort.

@kevinsawicki
Copy link
Contributor

Thanks for this, apologies for the delay in merging it.

kevinsawicki added a commit that referenced this pull request Apr 9, 2014
Returns alphabetically sorted paths
@kevinsawicki kevinsawicki merged commit 627d33c into atom:master Apr 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants