Merge pull request #7526 from MikeMcQuaid/uninstall-list-files

cmd/uninstall: note etc files that stay around.
This commit is contained in:
Mike McQuaid 2020-05-10 13:36:10 +01:00 committed by GitHub
commit 7bd454746e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,6 +80,27 @@ module Homebrew
puts "#{keg.name} #{versions.to_sentence} #{"is".pluralize(versions.count)} still installed."
puts "Run `brew uninstall --force #{keg.name}` to remove all versions."
end
paths = f.pkgetc.find.map(&:to_s) if f.pkgetc.exist?
if paths.present?
puts
opoo <<~EOS
The following #{f.name} configuration files have not been removed!
If desired, remove them manually with `rm -rf`:
#{paths.sort.uniq.join("\n ")}
EOS
end
unversioned_name = f.name.gsub(/@.+$/, "")
maybe_paths = Dir.glob("#{f.etc}/*#{unversioned_name}*") - paths
if maybe_paths.present?
puts
opoo <<~EOS
The following may be #{f.name} configuration files and have not been removed!
If desired, remove them manually with `rm -rf`:
#{maybe_paths.sort.uniq.join("\n ")}
EOS
end
end
end
end