Merge pull request #6829 from MikeMcQuaid/leaves-handle-missing-formula

cmd/leaves: handle missing formula.
This commit is contained in:
Mike McQuaid 2019-12-10 16:12:30 +00:00 committed by GitHub
commit 36a7fe59d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,16 +22,8 @@ module Homebrew
leaves_args.parse
installed = Formula.installed.sort
deps_of_installed = installed.flat_map do |f|
f.runtime_dependencies.map do |dep|
dep.to_formula.full_name
rescue FormulaUnavailableError
dep.name
end
end
leaves = installed.map(&:full_name) - deps_of_installed
deps_of_installed = installed.flat_map(&:runtime_formula_dependencies)
leaves = installed.map(&:full_name) - deps_of_installed.map(&:full_name)
leaves.each(&method(:puts))
end
end