Merge pull request #9472 from maxim-belkin/simpler-unusable-ruby-logic
utils/ruby.sh: simplify and fix Ruby-related logic
This commit is contained in:
commit
822988794e
@ -28,12 +28,14 @@ find_ruby() {
|
||||
fi
|
||||
}
|
||||
|
||||
unusable_ruby() {
|
||||
if [[ -n "$HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH" ]]
|
||||
need_vendored_ruby() {
|
||||
if [[ -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
|
||||
then
|
||||
return 0
|
||||
elif [[ -n "$HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH" ]]
|
||||
then
|
||||
return 1
|
||||
elif [[ -z "$HOMEBREW_MACOS" && -n "$HOMEBREW_RUBY_PATH" && -z "$HOMEBREW_FORCE_VENDOR_RUBY" ]] &&
|
||||
test_ruby "$HOMEBREW_RUBY_PATH"
|
||||
elif [[ -z "$HOMEBREW_MACOS" ]] && test_ruby "$HOMEBREW_RUBY_PATH"
|
||||
then
|
||||
return 1
|
||||
else
|
||||
@ -93,7 +95,7 @@ If there's no Homebrew Portable Ruby available for your processor:
|
||||
fi
|
||||
else
|
||||
HOMEBREW_RUBY_PATH=$(find_ruby)
|
||||
if [[ -z "$HOMEBREW_RUBY_PATH" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]] || unusable_ruby
|
||||
if need_vendored_ruby
|
||||
then
|
||||
brew vendor-install ruby || odie "$install_fail"
|
||||
HOMEBREW_RUBY_PATH="$vendor_ruby_path"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user