Open warnyul opened 5 years ago
Looks like the reason for the error is an empty progress_log_file
. There is a check for its existence but if the file is empty (for any crazy reason) split
will return an empty array and a result of last
method will be nil
.
Probably need a check for file emptiness or investigation why it is empty.
https://github.com/xcpretty/xcode-install/blob/18c402c3c487c83352a1669ba781fe9ac5574782/lib/xcode/install.rb#L90-L92
Insert the following lines instead of the line #92 progress_content = File.read(progress_log_file).split("\r").last
Looks like the reason for the error is an empty
progress_log_file
. There is a check for its existence but if the file is empty (for any crazy reason)split
will return an empty array and a result oflast
method will benil
. Probably need a check for file emptiness or investigation why it is empty.
Insert the following lines instead od #92:
progress_content_lines = File.read(progress_log_file)
next unless !progress_content_lines.empty?
progress_content = progress_content_lines.split("\r").last
I got crash during run:
xcversion install 11.2.1 --no-show-release-notes --no-ansi --no-progress
on Jenkins.ruby version: 2.4.0 xcversion: 2.6.3 system_profiler SPSoftwareDataType: Software: System Software Overview: System Version: macOS 10.15.1 (19B88) Kernel Version: Darwin 19.0.0 Boot Volume: Macintosh HD Boot Mode: Normal Computer Name: {cname} User Name: {user} Secure Virtual Memory: Enabled System Integrity Protection: Enabled Time since boot: 1 day 20:46