@@ -10,12 +10,6 @@ function log() {
1010 echo " ======================================="
1111}
1212
13-
14-
15- EXPECTED_RUBY_VERSION=$( cat ${SOURCE_ROOT_DIR} /.ruby-version)
16- ruby_version=" 2.4.4"
17- rbenv_version=" 2.5.7"
18-
1913log " 🏎️ Running React native setup script 🏎️"
2014
2115log " 📱 Installing xcode tools 📱"
2822echo " Xcode CommandLineTools installed 👍"
2923
3024if ! [ -x " $( command -v xcode-select) " ]; then
31- echo " ⚠️ You need Xcode to setuo this project. Please install and rerun this script ⚠️"
32- exit 1s
25+ echo " ⚠️ You need Xcode to setup this project. Please install and rerun this script ⚠️"
26+ exit 1
3327fi
3428
3529log " 👀 Looking for Homebrew 👀"
4337fi
4438
4539log " 👀 Looking for rbenv 👀"
46-
4740if ! [ -x " $( command -v rbenv) " ]; then
4841 echo " 🍺 Installing rbenv with brew 🍺"
49- brew install rbenv
42+ brew install rbenv ruby-build
5043 echo ' eval "$(rbenv init -)"' >> ~ /.bash_profile
5144 echo ' eval "$(rbenv init -)"' >> ~ /.zshrc
5245 eval " $( rbenv init -) "
53- rbenv install " 2.7.5"
5446else
55- rbenv install " 2.7.5"
5647 echo " rbenv already installed 👍"
5748fi
58- rbenv local " 2.7.5"
49+
50+ rbenv install --skip-existing
51+ echo " Ruby setup complete 👍"
52+
53+ log " 👀 Looking for nvm 👀"
54+ if ! [ -x " $( command -v nvm) " ]; then
55+ echo " 🍺 Installing nvm with brew 🍺"
56+ brew install nvm
57+ fi
58+
59+ # Source nvm
60+ export NVM_DIR=" $HOME /.nvm"
61+ [ -s " /opt/homebrew/opt/nvm/nvm.sh" ] && \. " /opt/homebrew/opt/nvm/nvm.sh"
62+
63+ nvm install
64+ echo " Node.js setup complete 👍"
5965
6066log " 👀 Looking for yarn 👀"
6167if ! [ -x " $( command -v yarn) " ]; then
6571 echo " yarn already installed 👍"
6672fi
6773
68- log " 👀 Looking for ruby 👀"
69- ruby-build --definitions | grep ^${EXPECTED_RUBY_VERSION} > /dev/null
70- RUBYBUILD_DEFS_EXIT_CODE=$?
71- if [ " $RUBYBUILD_DEFS_EXIT_CODE " -ne 0 ]; then
72- echo " 🍺 Ruby Build: Cannot find Ruby version required, updating via brew 🍺"
73- brew update && brew upgrade ruby-build
74- fi
75- rbenv install --skip-existing
76- echo " Ruby installed 👍"
77-
7874log " 📟 installing dependencies 📟"
7975yarn
8076
0 commit comments