13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/cocoapods-jxedt/git_helper/cache_fetcher.rb', line 13
def self.sync(binary_hash, to_dir)
fetch
require_relative 'zip'
cache_dir = Pathname.new(Jxedt.config.git_cache_path) + "GeneratedFrameworks"
to_dir = Pathname.new(to_dir)
binary_hash.each do |name, checksum|
zip_file = cache_dir + name + "#{checksum}.zip"
next unless zip_file.exist?
file_path = to_dir + name + "#{checksum}.checksum"
next if file_path.exist?
file_path.parent.rmtree if file_path.parent.exist?
Jxedt::ZipUtils.unzip(zip_file, :to_dir => to_dir)
Pod::UI.puts "✅ 已从缓存下载组件#{name}, 校验和:#{checksum}".yellow
end
end
|