Retry with ditto
when “End-of-central-directory signature not found.”.
This commit is contained in:
parent
e767ce642c
commit
62a0c2fed9
@ -548,6 +548,10 @@ class ErrorDuringExecution < RuntimeError
|
||||
|
||||
super s
|
||||
end
|
||||
|
||||
def stderr
|
||||
[*output].select { |type,| type == :stderr }.map(&:last).join
|
||||
end
|
||||
end
|
||||
|
||||
# Raised by {Pathname#verify_checksum} when "expected" is nil or empty.
|
||||
|
@ -2,7 +2,16 @@ module UnpackStrategy
|
||||
class Zip
|
||||
prepend Module.new {
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
result = super
|
||||
result = begin
|
||||
super
|
||||
rescue ErrorDuringExecution => e
|
||||
raise unless e.stderr.include?("End-of-central-directory signature not found.")
|
||||
|
||||
system_command! "ditto",
|
||||
args: ["-x", "-k", path, unpack_dir],
|
||||
verbose: verbose
|
||||
return
|
||||
end
|
||||
|
||||
volumes = result.stderr.chomp
|
||||
.split("\n")
|
||||
|
Loading…
x
Reference in New Issue
Block a user