cask-pr-inspect-download: remove open from URI (#92322)
This commit is contained in:
parent
66f3b6d60e
commit
410981fbec
|
@ -35,7 +35,7 @@ end
|
|||
|
||||
pr_api = pr_url.sub(%r{^https://github.com/([^/]+)/([^/]+)/pull/([^/]+).*},
|
||||
'https://api.github.com/repos/\1/\2/pulls/\3/files')
|
||||
pr_json = JSON.parse(URI.open(pr_api).read)
|
||||
pr_json = JSON.parse(URI(pr_api).read)
|
||||
|
||||
abort "PR needs to have a single file" if pr_json.count != 1
|
||||
|
||||
|
@ -46,7 +46,7 @@ tmp_cache_dir = Dir.mktmpdir
|
|||
tmp_download_dir = File.join(tmp_cache_dir, "downloads")
|
||||
|
||||
ENV["HOMEBREW_CACHE"] = tmp_cache_dir
|
||||
File.write(local_file, URI.open(file_raw_url).read)
|
||||
File.write(local_file, URI(file_raw_url).read)
|
||||
system("brew", "cask", "fetch", local_file)
|
||||
|
||||
downloaded_file = File.join(tmp_download_dir, Dir.children(tmp_download_dir).first)
|
||||
|
|
Loading…
Reference in New Issue