From 8b591b7d21858bd32fbde050e24adcadda2e5674 Mon Sep 17 00:00:00 2001 From: Pauloparakleto Date: Fri, 22 Mar 2024 14:28:49 -0300 Subject: [PATCH] chore(script/setup): Add support to RVM. Only evaluate to rbenv if rvm path is not found. --- script/setup | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/script/setup b/script/setup index d8f03ae63b..8e4c0aa941 100755 --- a/script/setup +++ b/script/setup @@ -19,11 +19,17 @@ NO_COLOR='\033[0m' # Check ruby version RUBY_VERSION=$(cat .ruby-version) -if command -v rbenv > /dev/null; then +if command -v rbenv > /dev/null && ! command rvm > /dev/null; then ./script/rbenv-install.sh -elif ! ruby --version | grep $RUBY_VERSION > /dev/null; then +fi + +if command rvm > /dev/null; then + ./script/rvm-install.sh +fi + +if ! ruby --version | grep $RUBY_VERSION > /dev/null; then printf "${RED}Open Food Network requires ruby ${RUBY_VERSION}${NO_COLOR}. " - printf "Have a look at: https://github.com/rbenv/rbenv\n" + printf "Have a look at your ruby version manager: https://github.com/rbenv/rbenv\n or https://rvm.io/" exit 1 fi