Merge pull request #15405 from Bo98/cleanup-version-fix

cleanup: fix version error for cache items without a version
This commit is contained in:
Bo Anderson 2023-05-11 16:16:27 +01:00 committed by GitHub
commit fff93a8781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,7 @@ module Homebrew
version ||= basename_str[/\A.*(?:--.*?)*--(.*?)#{Regexp.escape(pathname.extname)}\Z/, 1]
version ||= basename_str[/\A.*--?(.*?)#{Regexp.escape(pathname.extname)}\Z/, 1]
return false unless version
return false if version.blank?
version = Version.new(version)