cleanup: fix stale cask detection.
This method is also run to check formulae and if a formula and cask have the same name (e.g. `cmake`) then this method would mark all formulae downloads to being stale. Instead, check the `dirname` (which we're using for globs anyway) to double check that this is definitely a stale cask.
This commit is contained in:
parent
cbf049cc96
commit
6fe75fb154
@ -112,6 +112,8 @@ module CleanupRefinement
|
|||||||
def stale_cask?(scrub)
|
def stale_cask?(scrub)
|
||||||
return false unless name = basename.to_s[/\A(.*?)\-\-/, 1]
|
return false unless name = basename.to_s[/\A(.*?)\-\-/, 1]
|
||||||
|
|
||||||
|
return if dirname.basename.to_s != "Cask"
|
||||||
|
|
||||||
cask = begin
|
cask = begin
|
||||||
Cask::CaskLoader.load(name)
|
Cask::CaskLoader.load(name)
|
||||||
rescue Cask::CaskUnavailableError
|
rescue Cask::CaskUnavailableError
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user