Skip to content
Snippets Groups Projects
Unverified Commit 82298879 authored by Maxim Belkin's avatar Maxim Belkin Committed by GitHub
Browse files

Merge pull request #9472 from maxim-belkin/simpler-unusable-ruby-logic

utils/ruby.sh: simplify and fix Ruby-related logic
parents 2c77a540 15dbb0be
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment