cleanup-installed: remove command.
It's been deprecated for a few months and `brew bundle` is a far better tool for this than `cleanup-installed` was. Closes Homebrew/homebrew#38893. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
0705d75375
commit
332497b154
@ -1,28 +0,0 @@
|
||||
# DEPRECATED in favour of https://github.com/Homebrew/homebrew-brewdler
|
||||
#
|
||||
# brew-cleanup-installed: uninstall all non-whitelisted Homebrew formulae.
|
||||
#
|
||||
# Useful for maintainers/testers who regularly install lots of formulae
|
||||
# they don't actually use.
|
||||
#
|
||||
# Populate ~/.brew-cleanup-installed with the formulae you want to keep
|
||||
# installed. All others will be uninstalled when brew-cleanup-installed is run.
|
||||
|
||||
module Homebrew
|
||||
def cleanup_installed
|
||||
opoo <<-EOS.undent
|
||||
brew cleanup-installed is deprecated and will be removed soon!
|
||||
|
||||
Please consider using the `brew brewdle dump` and `brew brewdle cleanup`
|
||||
commands from https://github.com/Homebrew/homebrew-brewdler
|
||||
EOS
|
||||
cleanup_file = Pathname.new "#{ENV["HOME"]}/.brew-cleanup-installed"
|
||||
return unless cleanup_file.exist?
|
||||
|
||||
kept_formulae = cleanup_file.read.lines.map(&:strip)
|
||||
current_formulae = `brew list`.lines.map(&:strip)
|
||||
uninstall_formulae = current_formulae - kept_formulae
|
||||
return if uninstall_formulae.empty?
|
||||
safe_system "brew", "uninstall", "--force", *uninstall_formulae
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user