Apply suggestions from code review
Co-authored-by: Kevin <apainintheneck@gmail.com>
This commit is contained in:
parent
521c463e36
commit
a2612e23dc
@ -174,7 +174,7 @@ module Cask
|
||||
def install_time
|
||||
# <caskroom_path>/.metadata/<version>/<timestamp>/Casks/<token>.{rb,json} -> <timestamp>
|
||||
caskfile = installed_caskfile
|
||||
caskfile ? Time.strptime(caskfile.dirname.dirname.basename.to_s, Metadata::TIMESTAMP_FORMAT) : nil
|
||||
Time.strptime(caskfile.dirname.dirname.basename.to_s, Metadata::TIMESTAMP_FORMAT) if caskfile
|
||||
end
|
||||
|
||||
sig { returns(T.nilable(Pathname)) }
|
||||
|
@ -154,7 +154,7 @@ module Homebrew
|
||||
|
||||
stable = formula.stable
|
||||
if resource_name == "patch"
|
||||
patch_hashes = stable&.patches&.filter_map { _1.resource.version if _1.external }
|
||||
patch_hashes = stable&.patches&.filter_map { _1.resource.version if _1.external? }
|
||||
return true unless patch_hashes&.include?(Checksum.new(version.to_s))
|
||||
elsif resource_name && stable && (resource_version = stable.resources[resource_name]&.version)
|
||||
return true if resource_version != version
|
||||
|
Loading…
x
Reference in New Issue
Block a user