uses: further cleanup formula/cask argument handling
This commit is contained in:
parent
eab1c2ca53
commit
cb4e473384
@ -82,21 +82,17 @@ module Homebrew
|
|||||||
|
|
||||||
def intersection_of_dependents(use_runtime_dependents, used_formulae, args:)
|
def intersection_of_dependents(use_runtime_dependents, used_formulae, args:)
|
||||||
recursive = args.recursive?
|
recursive = args.recursive?
|
||||||
only = if args.formula?
|
show_formulae_and_casks = !args.formula? && !args.cask?
|
||||||
:formula
|
|
||||||
elsif args.cask?
|
|
||||||
:cask
|
|
||||||
end
|
|
||||||
includes, ignores = args_includes_ignores(args)
|
includes, ignores = args_includes_ignores(args)
|
||||||
|
|
||||||
deps = []
|
deps = []
|
||||||
if use_runtime_dependents
|
if use_runtime_dependents
|
||||||
unless only == :cask
|
if show_formulae_and_casks || args.formula?
|
||||||
deps += used_formulae.map(&:runtime_installed_formula_dependents)
|
deps += used_formulae.map(&:runtime_installed_formula_dependents)
|
||||||
.reduce(&:&)
|
.reduce(&:&)
|
||||||
.select(&:any_version_installed?)
|
.select(&:any_version_installed?)
|
||||||
end
|
end
|
||||||
unless only == :formula
|
if show_formulae_and_casks || args.cask?
|
||||||
deps += select_used_dependents(
|
deps += select_used_dependents(
|
||||||
dependents(Cask::Caskroom.casks(config: Cask::Config.from_args(args))),
|
dependents(Cask::Caskroom.casks(config: Cask::Config.from_args(args))),
|
||||||
used_formulae, recursive, includes, ignores
|
used_formulae, recursive, includes, ignores
|
||||||
@ -105,10 +101,10 @@ module Homebrew
|
|||||||
|
|
||||||
deps
|
deps
|
||||||
else
|
else
|
||||||
unless only == :cask
|
if show_formulae_and_casks || args.formula?
|
||||||
deps += args.installed? ? Formula.installed : Formula.to_a
|
deps += args.installed? ? Formula.installed : Formula.to_a
|
||||||
end
|
end
|
||||||
unless only == :formula
|
if show_formulae_and_casks || args.cask?
|
||||||
deps += args.installed? ? Cask::Caskroom.casks(config: Cask::Config.from_args(args)) : Cask::Cask.to_a
|
deps += args.installed? ? Cask::Caskroom.casks(config: Cask::Config.from_args(args)) : Cask::Cask.to_a
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user