Commit ca6cabc4 authored by Christopher Roach's avatar Christopher Roach

[LocalPod] Fixing clean paths

The earlier fix for clean paths is forcing some directories to lower
case which could cause some side effects. This fix removes the
`File::FNM_CASEFOLD` flag from the call to `Dir.glob` and allows the
OS to treat the directories as they wish. This makes the paths
returned in the `clean_paths` method consistent with those returned in
the `expanded_paths` method.
parent fe96a978
...@@ -166,11 +166,10 @@ module Pod ...@@ -166,11 +166,10 @@ module Pod
# @note The Paths are downcased to prevent issues. See #568. # @note The Paths are downcased to prevent issues. See #568.
# #
def clean_paths def clean_paths
used = used_files.map(&:downcase) files = Dir.glob(root + "**/*", File::FNM_DOTMATCH)
files = Dir.glob(root + "**/*", File::FNM_DOTMATCH).map(&:downcase)
files.reject! do |candidate| files.reject! do |candidate|
candidate.end_with?('.', '..') || used.any? do |path| candidate.end_with?('.', '..') || used_files.any? do |path|
path.include?(candidate) || candidate.include?(path) path.include?(candidate) || candidate.include?(path)
end end
end end
...@@ -536,7 +535,7 @@ module Pod ...@@ -536,7 +535,7 @@ module Pod
if pattern.directory? && options[:glob] if pattern.directory? && options[:glob]
pattern += options[:glob] pattern += options[:glob]
end end
Pathname.glob(pattern, File::FNM_CASEFOLD) Pathname.glob(pattern)
end.flatten end.flatten
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment