From 9394fe2b5211e5a5f5a3d2bb5b991a3c7ccc7bc4 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Fri, 5 Feb 2021 12:34:11 +0000 Subject: [PATCH] utils/github: Use constant everywhere for "create a PAT" message - This way if we ever change this messaging, we only have to do so once. --- Library/Homebrew/utils/github.rb | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index 27b832daa6..d8d5effc24 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -49,9 +49,8 @@ module GitHub @github_message = github_message super <<~EOS GitHub API Error: #{github_message} - Try again in #{pretty_ratelimit_reset(reset)}, or create a personal access token: - #{ALL_SCOPES_URL} - #{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")} + Try again in #{pretty_ratelimit_reset(reset)}, or: + #{CREATE_GITHUB_PAT_MESSAGE} EOS end @@ -75,9 +74,7 @@ module GitHub The GitHub credentials in the macOS keychain may be invalid. Clear them with: printf "protocol=https\\nhost=github.com\\n" | git credential-osxkeychain erase - Or create a personal access token: - #{ALL_SCOPES_URL} - #{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")} + #{CREATE_GITHUB_PAT_MESSAGE} EOS end super message.freeze @@ -182,9 +179,7 @@ module GitHub Your #{what} credentials do not have sufficient scope! Scopes required: #{needed_scopes} Scopes present: #{credentials_scopes} - Create a personal access token: - #{ALL_SCOPES_URL} - #{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")} + #{CREATE_GITHUB_PAT_MESSAGE} EOS end