6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/pod_builder/command/update.rb', line 6
def self.call
Configuration.check_inited
PodBuilder::prepare_basepath
info = PodBuilder::Info.generate_info()
swift_version = PodBuilder::system_swift_version
pods_to_update = []
info.each do |pod_name, info|
if info.dig(:restore_info, :version) != info.dig(:prebuilt_info, :version)
pods_to_update.append(pod_name)
end
if (prebuilt_swift_version = info.dig(:prebuilt_info, :swift_version)) && prebuilt_swift_version != swift_version
pods_to_update.append(pod_name)
end
end
pods_to_update.map! { |x| x.split("/").first }.uniq!
unless pods_to_update.count > 0
puts "Prebuilt items in sync!\n".green
return 0
end
if OPTIONS.has_key?(:dry_run)
puts "`#{pods_to_update.join("`, `")}` need to be rebuilt!\n".red
return -2
end
ARGV.clear
pods_to_update.each { |x| ARGV << x }
return PodBuilder::Command::Build.call
end
|