Skip to content

Commit

Permalink
Try matching key type
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Nov 7, 2024
1 parent a81b6a4 commit c17ffb8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Library/Homebrew/cmd/outdated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,12 @@ def run
end

json = {
"formulae" => json_info(formulae),
"casks" => json_info(casks),
formulae: json_info(formulae),
casks: json_info(casks),
}
puts JSON.pretty_generate(json)

outdated = formulae + casks

else
outdated = if args.formula?
outdated_formulae
Expand Down Expand Up @@ -170,10 +169,7 @@ def json_version(version)
"v1" => :v1,
"v2" => :v2,
}

raise UsageError, "invalid JSON version: #{version}" unless version_hash.include?(version)

version_hash[version]
version_hash.fetch(version) { raise UsageError, "invalid JSON version: #{version}" }
end

sig { returns(T::Array[Formula]) }
Expand Down

0 comments on commit c17ffb8

Please sign in to comment.