Fix basename for extracting cask downloads.

This commit is contained in:
Markus Reiter 2020-12-21 15:43:25 +01:00
parent 993bf95877
commit 82c1e6fb0e
2 changed files with 11 additions and 3 deletions

View File

@ -52,6 +52,10 @@ module Cask
downloader.cached_location
end
def basename
downloader.basename
end
def verify_download_integrity(fn)
if @cask.sha256 == :no_check
opoo "No checksum defined for cask '#{@cask}', skipping verification."

View File

@ -152,10 +152,14 @@ module Cask
s.freeze
end
sig { returns(Download) }
def downloader
@downloader ||= Download.new(@cask, quarantine: quarantine?)
end
sig { returns(Pathname) }
def download
@download ||= Download.new(@cask, quarantine: quarantine?)
.fetch(verify_download_integrity: @verify_download_integrity)
@download ||= downloader.fetch(verify_download_integrity: @verify_download_integrity)
end
def verify_has_sha
@ -180,7 +184,7 @@ module Cask
odebug "Using container class #{primary_container.class} for #{primary_container.path}"
basename = CGI.unescape(File.basename(@cask.url.path))
basename = downloader.basename
if nested_container = @cask.container&.nested
Dir.mktmpdir do |tmpdir|