cmd/leaves: handle missing formula.
Use `runtime_formula_dependencies` which does this for us. Fixes #6827.
This commit is contained in:
parent
cf1002b8e5
commit
3f348286f9
@ -22,16 +22,8 @@ module Homebrew
|
|||||||
leaves_args.parse
|
leaves_args.parse
|
||||||
|
|
||||||
installed = Formula.installed.sort
|
installed = Formula.installed.sort
|
||||||
|
deps_of_installed = installed.flat_map(&:runtime_formula_dependencies)
|
||||||
deps_of_installed = installed.flat_map do |f|
|
leaves = installed.map(&:full_name) - deps_of_installed.map(&:full_name)
|
||||||
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
|
|
||||||
leaves.each(&method(:puts))
|
leaves.each(&method(:puts))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user