Skip to content

Commit

Permalink
Test: Support multiple CDNs
Browse files Browse the repository at this point in the history
  • Loading branch information
esteluk committed Apr 26, 2024
1 parent d9cdb56 commit 4620935
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lib/cocoapods-core/cdn_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,19 @@ def ensure_versions_file_loaded(fragment)
# We use those because you can't get a directory listing from a CDN.
index_file_name = index_file_name_for_fragment(fragment)
download_file(index_file_name)
versions_raw = local_file(index_file_name, &:to_a).map(&:chomp)
@version_arrays_by_fragment_by_name[fragment] = versions_raw.reduce({}) do |hash, row|
row = row.split('/')
pod = row.shift
versions = row

hash[pod] = versions
hash
file_okay = local_file_okay?(index_file_name)
if file_okay
versions_raw = local_file(index_file_name, &:to_a).map(&:chomp)
@version_arrays_by_fragment_by_name[fragment] = versions_raw.reduce({}) do |hash, row|
row = row.split('/')
pod = row.shift
versions = row

hash[pod] = versions
hash
end
else
debug "CDN: #{name} Relative path: #{partial_url} not available in this source set"
end
end

Expand Down

0 comments on commit 4620935

Please sign in to comment.