brew style --fix

This commit is contained in:
Douglas Eichelberger 2023-11-05 09:10:28 -08:00
parent 0191af7899
commit 75179e9239
2 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ module Cask
source_string, target_hash = args
if target_hash
raise CaskInvalidError.new(cask) unless target_hash.respond_to?(:keys)
raise CaskInvalidError, cask unless target_hash.respond_to?(:keys)
target_hash.assert_valid_keys(:target)
end

View File

@ -68,9 +68,9 @@ module Utils
else
bottle_json_path = Pathname(bottle_file.sub(/\.(\d+\.)?tar\.gz$/, ".json"))
if bottle_json_path.exist? &&
(bottle_json_path_contents = bottle_json_path.read.presence) &&
(bottle_json = JSON.parse(bottle_json_path_contents).presence) &&
bottle_json.is_a?(Hash)
(bottle_json_path_contents = bottle_json_path.read.presence) &&
(bottle_json = JSON.parse(bottle_json_path_contents).presence) &&
bottle_json.is_a?(Hash)
bottle_json.keys.first.presence
end
end