Don’t glob for .incomplete downloads.

This commit is contained in:
Markus Reiter 2018-08-25 21:57:52 +02:00
parent b7847e4657
commit 9edc355052

View File

@ -206,6 +206,7 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
url_sha256 = Digest::SHA256.hexdigest(url)
downloads = Pathname.glob(HOMEBREW_CACHE/"downloads/#{url_sha256}--*")
.reject { |path| path.extname.end_with?(".incomplete") }
@cached_location = if downloads.count == 1
downloads.first