Fix calls to 'test_ruby' in conditional statements

Co-authored-by: Shaun Jackman <sjackman@gmail.com>
This commit is contained in:
Maxim Belkin 2020-06-06 12:03:51 -05:00 committed by GitHub
parent 58f3e49c0b
commit 9751d3bb8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,7 @@ If there's no Homebrew Portable Ruby available for your processor:
IFS=$'\n' # Do word splitting on new lines only IFS=$'\n' # Do word splitting on new lines only
for ruby_exec in $(which -a ruby) $(PATH=$HOMEBREW_PATH which -a ruby) for ruby_exec in $(which -a ruby) $(PATH=$HOMEBREW_PATH which -a ruby)
do do
if [[ $(test_ruby "$ruby_exec") == "true" ]]; then if test_ruby "$ruby_exec"; then
HOMEBREW_RUBY_PATH=$ruby_exec HOMEBREW_RUBY_PATH=$ruby_exec
break break
fi fi
@ -76,9 +76,9 @@ If there's no Homebrew Portable Ruby available for your processor:
if [[ -n "$HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH" ]] if [[ -n "$HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH" ]]
then then
usable_ruby_version="true" 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 then
usable_ruby_version=$(test_ruby "$HOMEBREW_RUBY_PATH") usable_ruby_version=true
fi fi
if [[ -z "$HOMEBREW_RUBY_PATH" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" || "$usable_ruby_version" != "true" ]] if [[ -z "$HOMEBREW_RUBY_PATH" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" || "$usable_ruby_version" != "true" ]]