Move update logic to source.rb

parent 9952a849
...@@ -124,6 +124,8 @@ module Pod ...@@ -124,6 +124,8 @@ module Pod
sets = set_names.map do |name| sets = set_names.map do |name|
aggregate.representative_set(name) aggregate.representative_set(name)
end end
# Remove nil values because representative_set return nil if no pod is found in any of the sources.
sets.compact!
else else
sets = aggregate.search_by_name(query, false) sets = aggregate.search_by_name(query, false)
end end
...@@ -256,24 +258,13 @@ module Pod ...@@ -256,24 +258,13 @@ module Pod
changed_spec_paths = {} changed_spec_paths = {}
sources.each do |source| sources.each do |source|
UI.section "Updating spec repo `#{source.name}`" do UI.section "Updating spec repo `#{source.name}`" do
Dir.chdir(source.repo) do changed_spec_paths[source] = source.update(show_output && !config.verbose?)
begin
prev_commit_hash = (git! %w(rev-parse HEAD)).strip
output = git! %w(pull --ff-only)
changed_spec_paths[source] = (git! %W(diff --name-only #{prev_commit_hash}..HEAD)).strip.split("\n")
UI.puts output if show_output && !config.verbose?
rescue Informative
UI.warn 'CocoaPods was not able to update the ' \
"`#{source.name}` repo. If this is an unexpected issue " \
'and persists you can inspect it running ' \
'`pod repo update --verbose`'
end
end
check_version_information(source.repo) check_version_information(source.repo)
end end
end end
# Perform search index update operation as a subprocess. # Perform search index update operation as a subprocess.
fork do Process.fork do
Process.daemon
update_search_index_if_needed(changed_spec_paths) update_search_index_if_needed(changed_spec_paths)
exit exit
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