cmd/info: generate --json=v2 from local taps.
Fixes #14541 Co-authored-by: Issy Long <issyl0@github.com>
This commit is contained in:
parent
ff5e517949
commit
dbf02366b2
@ -222,6 +222,14 @@ module Homebrew
|
|||||||
formulae.map(&:to_hash)
|
formulae.map(&:to_hash)
|
||||||
end
|
end
|
||||||
when :v2
|
when :v2
|
||||||
|
# Cannot generate cask API JSON data from the cask JSON API
|
||||||
|
if EnvConfig.install_from_api?
|
||||||
|
ENV["HOMEBREW_NO_INSTALL_FROM_API"] = "1"
|
||||||
|
core_untapped = !CoreTap.instance.installed?
|
||||||
|
cask_untapped = !Tap.fetch("Homebrew/homebrew-cask").installed?
|
||||||
|
raise UsageError, "tap homebrew/core and/or homebrew/cask to use --json=v2" if core_untapped || cask_untapped
|
||||||
|
end
|
||||||
|
|
||||||
formulae, casks = if all
|
formulae, casks = if all
|
||||||
[Formula.all.sort, Cask::Cask.all.sort_by(&:full_name)]
|
[Formula.all.sort, Cask::Cask.all.sort_by(&:full_name)]
|
||||||
elsif args.installed?
|
elsif args.installed?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user