lib/xcode/install.rb in xcode-install-0.9.4 vs lib/xcode/install.rb in xcode-install-0.9.5

- old
+ new

@@ -88,10 +88,14 @@ end `sudo ditto "#{source}" "#{xcode_path}"` `umount "/Volumes/Xcode"` + if not verify_integrity(xcode_path) + `sudo rm -f #{xcode_path}` + end + enable_developer_mode `sudo xcodebuild -license` unless xcode_license_approved? install_components(xcode_path) if components if switch @@ -236,9 +240,14 @@ end def seedlist @xcodes = Marshal.load(File.read(LIST_FILE)) if LIST_FILE.exist? && xcodes.nil? xcodes || fetch_seedlist + end + + def verify_integrity(path) + puts `codesign --verify --verbose #{path}` + $?.exitstatus == 0 end def xcode_license_approved? !(`/usr/bin/xcrun clang 2>&1` =~ /license/ && !$CHILD_STATUS.success?) end