bump-formula-pr.rb: Apply suggestions from code review

Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Maxim Belkin 2019-11-20 09:43:45 -06:00
parent a031fe911e
commit ba7a05a919
No known key found for this signature in database
GPG Key ID: AC71560D4C5F2338

View File

@ -388,10 +388,10 @@ module Homebrew
else
# GitHub API responds immediately but fork takes a few seconds to be ready.
sleep 1 until GitHub.check_fork_exists(tap_full_name)
if system("git", "config", "--local", "--get-regexp", "remote\..*\.url", "git@github.com:.*")
remote_url = response.fetch("ssh_url")
remote_url = if system("git", "config", "--local", "--get-regexp", "remote\..*\.url", "git@github.com:.*")
response.fetch("ssh_url")
else
remote_url = response.fetch("clone_url")
response.fetch("clone_url")
end
username = response.fetch("owner").fetch("login")
[remote_url, username]