dev-cmd/contributions: Use --repositories not --repos

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Issy Long 2022-07-29 21:19:42 +01:00
parent 1ac1097203
commit f5d5778186
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -28,10 +28,10 @@ module Homebrew
flag "--to=", flag "--to=",
description: "Date (ISO-8601 format) to stop searching contributions." description: "Date (ISO-8601 format) to stop searching contributions."
comma_array "--repos=", comma_array "--repositories=",
description: "The Homebrew repositories to search for contributions in. " \ description: "The Homebrew repositories to search for contributions in. " \
"Comma separated. Pass `all` to search all repos. " \ "Comma separated. Pass `all` to search all repositories. " \
"Supported repos: #{SUPPORTED_REPOS.join(", ")}." "Supported repositories: #{SUPPORTED_REPOS.join(", ")}."
named_args :email, number: 1 named_args :email, number: 1
end end
@ -44,18 +44,18 @@ module Homebrew
commits = 0 commits = 0
coauthorships = 0 coauthorships = 0
all_repos = args[:repos].first == "all" all_repos = args[:repositories].first == "all"
repos = all_repos ? SUPPORTED_REPOS : args[:repos] repos = all_repos ? SUPPORTED_REPOS : args[:repositories]
repos.each do |repo| repos.each do |repo|
if SUPPORTED_REPOS.exclude?(repo) if SUPPORTED_REPOS.exclude?(repo)
return ofail "Unsupported repo: #{repo}. Try one of #{SUPPORTED_REPOS.join(", ")}." return ofail "Unsupported repository: #{repo}. Try one of #{SUPPORTED_REPOS.join(", ")}."
end end
repo_path = find_repo_path_for_repo(repo) repo_path = find_repo_path_for_repo(repo)
unless repo_path.exist? unless repo_path.exist?
next if repo == "versions" # This tap is deprecated, tapping it will error. next if repo == "versions" # This tap is deprecated, tapping it will error.
opoo "Couldn't find repo #{repo} locally. Tapping it now..." opoo "Repository #{repo} not yet tapped! Tapping it now..."
Utils.safe_system("brew", "tap", repo_path) # TODO: Figure out why `exit code 1` happens here. Utils.safe_system("brew", "tap", repo_path) # TODO: Figure out why `exit code 1` happens here.
end end