- if [ $REQUIRES_SERVER = "true" ]; then nvm install 6.9.3; fi
- if [ $REQUIRES_SERVER = "true" ]; then nvm use 6.9.3; fi
- if [ $REQUIRES_SERVER = "true" ]; then npm i -g npm@6; fi
- if [ $REQUIRES_SERVER = "true" ]; then sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10; fi
- if [ $REQUIRES_SERVER = "true" ]; then echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list; fi
- if [ $REQUIRES_SERVER = "true" ]; then sudo apt-get update || true; fi
- if [ $REQUIRES_SERVER = "true" ]; then sudo apt-get -y install mongodb; fi
- if [ $REQUIRES_SERVER = "true" ]; then git clone https://github.com/HabitRPG/habitica.git; fi
- if [ $REQUIRES_SERVER = "true" ]; then until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 2; done; fi
- if [ $REQUIRES_SERVER = "true" ]; then cd habitica && cp config.json.example config.json && npm install; fi
- if [ $REQUIRES_SERVER = "true" ]; then npm start; fi &
- if [ $REQUIRES_SERVER = "true" ]; then until nc -z localhost 3000; do echo Waiting for Habitica Server; sleep 2; done; fi