diff options
Diffstat (limited to 'Library/Homebrew/utils')
| -rw-r--r-- | Library/Homebrew/utils/github.rb | 12 | ||||
| -rw-r--r-- | Library/Homebrew/utils/shell.rb | 4 |
2 files changed, 3 insertions, 13 deletions
diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index a50d6d8e5..df0811e95 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -86,15 +86,9 @@ module GitHub def api_credentials_type token, username = api_credentials - if token && !token.empty? - if username && !username.empty? - :keychain - else - :environment - end - else - :none - end + return :none if !token || token.empty? + return :keychain if !username || username.empty? + :environment end def api_credentials_error_message(response_headers, needed_scopes) diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index 5327f6ecf..8c1c5f984 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -51,8 +51,6 @@ module Utils end end - private - SHELL_PROFILE_MAP = { bash: "~/.bash_profile", csh: "~/.cshrc", @@ -65,8 +63,6 @@ module Utils UNSAFE_SHELL_CHAR = %r{([^A-Za-z0-9_\-.,:/@\n])} - module_function - def csh_quote(str) # ruby's implementation of shell_escape str = str.to_s |
