update: highlight currently-installed casks

This commit is contained in:
EricFromCanada 2020-03-05 11:14:37 -05:00
parent d5a785374e
commit b75b39097d

View File

@ -441,6 +441,9 @@ class ReporterHub
"#{name} -> #{new_name}" "#{name} -> #{new_name}"
when :A when :A
name unless installed?(name) name unless installed?(name)
when :MC, :DC
name = name.split("/").last
cask_installed?(name) ? pretty_installed(name) : name
else else
installed?(name) ? pretty_installed(name) : name installed?(name) ? pretty_installed(name) : name
end end
@ -456,4 +459,8 @@ class ReporterHub
def installed?(formula) def installed?(formula)
(HOMEBREW_CELLAR/formula.split("/").last).directory? (HOMEBREW_CELLAR/formula.split("/").last).directory?
end end
def cask_installed?(cask)
(Cask::Caskroom.path/cask).directory?
end
end end