Warn of legacy installs in doctor

This commit is contained in:
Josh Hagins
2015-12-09 19:35:23 +00:00
committed by Mike McQuaid
parent 72ff99a7f1
commit 4955bac9a9
+6 -3
View File
@@ -184,9 +184,12 @@ class Hbc::CLI::Doctor < Hbc::CLI::Base
# things are less dependable.
def self.render_install_location(current_version)
locations = Dir.glob(homebrew_cellar.join('brew-cask', '*')).reverse
locations.each do |l|
basename = File.basename l
l.concat %Q{ #{error_string %Q{error: old version. Run "brew cleanup".}}} unless basename == current_version
if locations.empty?
none_string
else
locations.collect do |l|
%Q{#{l} #{error_string %Q{error: legacy install. Run "brew uninstall --force brew-cask".}}}
end
end
end