cleanup: fix for formula/cask name collision
When a formula and cask share the same name, a download can be incorrectly considered stale. Only check for if a download is a stale formula or stale cask, but not both.
This commit is contained in:
parent
db68e7e3c1
commit
2c95d733c2
@ -59,7 +59,11 @@ module CleanupRefinement
|
||||
def stale?(scrub = false)
|
||||
return false unless resolved_path.file?
|
||||
|
||||
stale_formula?(scrub) || stale_cask?(scrub)
|
||||
if dirname.basename.to_s == "Cask"
|
||||
stale_cask?(scrub)
|
||||
else
|
||||
stale_formula?(scrub)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
@ -113,8 +117,6 @@ module CleanupRefinement
|
||||
def stale_cask?(scrub)
|
||||
return false unless name = basename.to_s[/\A(.*?)\-\-/, 1]
|
||||
|
||||
return if dirname.basename.to_s != "Cask"
|
||||
|
||||
cask = begin
|
||||
Cask::CaskLoader.load(name)
|
||||
rescue Cask::CaskUnavailableError
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user