Don't redownload “latest” casks unnecessarily.

This commit is contained in:
Markus Reiter 2019-05-31 20:37:57 +02:00
parent 7640dfe601
commit b12623f4eb
2 changed files with 3 additions and 1 deletions

View File

@ -35,7 +35,7 @@ module Cask
attr_accessor :downloaded_path
def clear_cache
downloader.clear_cache if force || cask.version.latest?
downloader.clear_cache if force
end
def fetch

View File

@ -296,6 +296,8 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
fresh = if cached_location.exist? && url_time
url_time <= cached_location.mtime
elsif version.respond_to?(:latest?)
!version.latest?
else
true
end