lib/cocoapods-jxedt/command/binary/command/statistics.rb in cocoapods-jxedt-0.0.16 vs lib/cocoapods-jxedt/command/binary/command/statistics.rb in cocoapods-jxedt-0.0.17
- old
+ new
@@ -35,11 +35,15 @@
pods_root = Pathname.new(File.dirname(podfile.defined_in_file)) + "Pods"
binary_dir = pods_root + Jxedt.config.binary_dir
used_binary = []
Dir.glob("#{pods_root}/*/_Prebuild") do |file_path|
+ # 不是目录,不处理
next unless File.directory?(file_path)
+ # 目录下文件为空不处理
+ next if Dir["#{file_path}/*"].empty?
+
dir_name = File.dirname(file_path)
name = File.basename(dir_name).to_s
target_path = binary_dir + name
next unless target_path.exist? # 路径不存在,跳过
@@ -62,9 +66,12 @@
# print
index, failed = 0, []
used_binary.sort_by {|hash| hash[:name].capitalize }.each do |hash|
name = hash[:name]
+
+ # lockfile中没有则跳过
+ next unless lockfile.internal_data["SPEC CHECKSUMS"].include?(name)
checksum = lockfile.spec_checksums_hash_key(name)
validation_passed = checksum && checksum == hash[:checksum] && hash[:checksum_count] == 1
failed << name unless validation_passed
\ No newline at end of file