Skip to content

Commit

Permalink
[PathList] Use Dir.glob instead of Find.find for speed
Browse files Browse the repository at this point in the history
[FileReferencesInstaller] Do not refresh local pods
  • Loading branch information
manuyavuz committed Dec 23, 2019
1 parent 80c3bc3 commit 3a73cfc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ def install!
# @return [void]
#
def refresh_file_accessors
file_accessors.map(&:path_list).uniq.each(&:read_file_system)
file_accessors.reject do |file_accessor|
pod_name = file_accessor.spec.name
sandbox.local?(pod_name)
end.map(&:path_list).uniq.each(&:read_file_system)
end

# Prepares the main groups to which all files will be added for the respective target
Expand Down
6 changes: 4 additions & 2 deletions lib/cocoapods/sandbox/path_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ def read_file_system
unless root.exist?
raise Informative, "Attempt to read non existent folder `#{root}`."
end

dirs = []
files = []
root_length = root.cleanpath.to_s.length + File::SEPARATOR.length
Find.find(root.to_s) do |f|
Dir.glob(root + '**/*', File::FNM_DOTMATCH).each do |f|
directory = File.directory?(f)
# Ignore `.` and `..` directories
next if directory && f =~ /\.\.?$/

f = f.slice(root_length, f.length - root_length)
next if f.nil?

Expand Down

0 comments on commit 3a73cfc

Please sign in to comment.