Merge pull request #14543 from MikeMcQuaid/info-json-api
cmd/info: generate `--json=v2` from local taps.
This commit is contained in:
commit
206d4c86b3
@ -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