Skip to content

Commit

Permalink
🐛 Fixes from Issue #860 and PR #777
Browse files Browse the repository at this point in the history
- Remove sort that scrambles path collections order
- Ensure directory listing behavior
  • Loading branch information
mkarlesky committed May 18, 2024
1 parent ee00c88 commit 90935a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/ceedling/file_path_collection_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def collect_paths(paths)
(Pathname.new( path ).relative_path_from( @working_dir_path )).to_s()
end

return paths.sort()
return paths
end


Expand All @@ -110,8 +110,7 @@ def revise_filelist(list, revisions)
filepaths = []

# Expand path by pattern as needed and add only filepaths to working list
# Note: `sort()` becuase of Github Issue #860
@file_wrapper.directory_listing( path ).sort.each do |entry|
@file_wrapper.directory_listing( path ).each do |entry|
filepaths << File.expand_path( entry ) if !@file_wrapper.directory?( entry )
end

Expand Down
4 changes: 3 additions & 1 deletion lib/ceedling/file_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def dirname(path)
end

def directory_listing(glob)
return Dir.glob(glob, File::FNM_PATHNAME) # Case insensitive globs
# Note: `sort()` to ensure platform-independent directory listings (Github Issue #860)
# FNM_PATHNAME => Case insensitive globs
return Dir.glob(glob, File::FNM_PATHNAME).sort()
end

def rm_f(filepath, options={})
Expand Down

0 comments on commit 90935a1

Please sign in to comment.