From 9751d3bb8c884f6994739160bfaa40aee831b3e6 Mon Sep 17 00:00:00 2001 From: Maxim Belkin Date: Sat, 6 Jun 2020 12:03:51 -0500 Subject: [PATCH] Fix calls to 'test_ruby' in conditional statements Co-authored-by: Shaun Jackman --- Library/Homebrew/utils/ruby.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh index f26beaaaed..36ea8d817b 100644 --- a/Library/Homebrew/utils/ruby.sh +++ b/Library/Homebrew/utils/ruby.sh @@ -64,7 +64,7 @@ If there's no Homebrew Portable Ruby available for your processor: IFS=$'\n' # Do word splitting on new lines only for ruby_exec in $(which -a ruby) $(PATH=$HOMEBREW_PATH which -a ruby) do - if [[ $(test_ruby "$ruby_exec") == "true" ]]; then + if test_ruby "$ruby_exec"; then HOMEBREW_RUBY_PATH=$ruby_exec break fi @@ -76,9 +76,9 @@ If there's no Homebrew Portable Ruby available for your processor: if [[ -n "$HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH" ]] then usable_ruby_version="true" - elif [[ -n "$HOMEBREW_RUBY_PATH" && -z "$HOMEBREW_FORCE_VENDOR_RUBY" ]] + elif [[ -n "$HOMEBREW_RUBY_PATH" && -z "$HOMEBREW_FORCE_VENDOR_RUBY" ]] && test_ruby "$HOMEBREW_RUBY_PATH" then - usable_ruby_version=$(test_ruby "$HOMEBREW_RUBY_PATH") + usable_ruby_version=true fi if [[ -z "$HOMEBREW_RUBY_PATH" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" || "$usable_ruby_version" != "true" ]]