Skip to content

Commit

Permalink
Don't redownload “latest” casks unnecessarily.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed May 31, 2019
1 parent 7640dfe commit b12623f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def downloader
attr_accessor :downloaded_path

def clear_cache
downloader.clear_cache if force || cask.version.latest?
downloader.clear_cache if force
end

def fetch
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/download_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ def fetch

fresh = if cached_location.exist? && url_time
url_time <= cached_location.mtime
elsif version.respond_to?(:latest?)
!version.latest?
else
true
end
Expand Down

0 comments on commit b12623f

Please sign in to comment.