Use sort_by in missing deps doctor check
This commit is contained in:
parent
5375f2397e
commit
804872fc94
@ -891,16 +891,16 @@ end
|
|||||||
|
|
||||||
def check_missing_deps
|
def check_missing_deps
|
||||||
return unless HOMEBREW_CELLAR.exist?
|
return unless HOMEBREW_CELLAR.exist?
|
||||||
s = Set.new
|
missing = Set.new
|
||||||
Homebrew.missing_deps(Formula.installed).each_value do |deps|
|
Homebrew.missing_deps(Formula.installed).each_value do |deps|
|
||||||
s.merge deps
|
missing.merge(deps)
|
||||||
end
|
end
|
||||||
|
|
||||||
if s.length > 0 then <<-EOS.undent
|
if missing.any? then <<-EOS.undent
|
||||||
Some installed formula are missing dependencies.
|
Some installed formula are missing dependencies.
|
||||||
You should `brew install` the missing dependencies:
|
You should `brew install` the missing dependencies:
|
||||||
|
|
||||||
brew install #{s.to_a.sort * " "}
|
brew install #{missing.sort_by(&:name) * " "}
|
||||||
|
|
||||||
Run `brew missing` for more details.
|
Run `brew missing` for more details.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user