chore(script/setup): Add support to RVM. Only evaluate to rbenv if rvm path is not found.

This commit is contained in:
Pauloparakleto
2024-03-22 14:28:49 -03:00
committed by Pauloparakleto
parent 42520216aa
commit 8b591b7d21

View File

@@ -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