Fix downloads
directory not being created.
This commit is contained in:
parent
beb6656278
commit
2ca3439ada
@ -292,6 +292,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
|||||||
raise CurlDownloadStrategyError, url
|
raise CurlDownloadStrategyError, url
|
||||||
end
|
end
|
||||||
ignore_interrupts do
|
ignore_interrupts do
|
||||||
|
cached_location.dirname.mkpath
|
||||||
temporary_path.rename(cached_location)
|
temporary_path.rename(cached_location)
|
||||||
symlink_location.dirname.mkpath
|
symlink_location.dirname.mkpath
|
||||||
end
|
end
|
||||||
@ -347,8 +348,6 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def _fetch(url:, resolved_url:)
|
def _fetch(url:, resolved_url:)
|
||||||
temporary_path.dirname.mkpath
|
|
||||||
|
|
||||||
ohai "Downloading from #{resolved_url}" if url != resolved_url
|
ohai "Downloading from #{resolved_url}" if url != resolved_url
|
||||||
|
|
||||||
if ENV["HOMEBREW_NO_INSECURE_REDIRECT"] &&
|
if ENV["HOMEBREW_NO_INSECURE_REDIRECT"] &&
|
||||||
|
@ -47,8 +47,10 @@ def curl(*args)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def curl_download(*args, to: nil, continue_at: "-", **options)
|
def curl_download(*args, to: nil, continue_at: "-", **options)
|
||||||
had_incomplete_download ||= File.exist?(to)
|
destination = Pathname(to)
|
||||||
curl("--location", "--remote-time", "--continue-at", continue_at.to_s, "--output", to, *args, **options)
|
had_incomplete_download ||= destination.exist?
|
||||||
|
destination.dirname.mkpath
|
||||||
|
curl("--location", "--remote-time", "--continue-at", continue_at.to_s, "--output", destination, *args, **options)
|
||||||
rescue ErrorDuringExecution => e
|
rescue ErrorDuringExecution => e
|
||||||
# `curl` error 33: HTTP server doesn't seem to support byte ranges. Cannot resume.
|
# `curl` error 33: HTTP server doesn't seem to support byte ranges. Cannot resume.
|
||||||
# HTTP status 416: Requested range not satisfiable
|
# HTTP status 416: Requested range not satisfiable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user