setup.sh
1 #! /bin/bash 2 3 if [[ -z "$MIX_HOME" || -z "$HEX_HOME" ]]; then 4 echo "Ensure the \$MIX_HOME and \$HEX_HOME environment variables are set. (Should be done in the Nix flake.)" 5 exit 1 6 fi 7 8 echo "Installing Poetry..." 9 pipx install poetry 10 11 echo "Installing Rebar, Hex, and Livebook..." 12 mkdir -p "$MIX_HOME" && 13 mkdir -p "$HEX_HOME" && 14 mix local.rebar --force --if-missing && 15 mix "do" local.rebar --force --if-missing && 16 mix "do" local.hex --force --if-missing && 17 if [ ! -f "$MIX_HOME/escripts/livebook" ]; then mix escript.install hex livebook --force; fi 18 19 echo "Installing contract dependencies..." 20 (cd ./programs && yarn install --dev) 21 22 echo "Installing research dependencies..." 23 (cd ./research && poetry install --with=dev) 24 25 echo "Installing app dependencies..." 26 (cd ./services/app && mix setup) 27 28 echo "Installing site dependencies..." 29 (cd ./services/node && yarn install --dev) 30 31 echo "Installing site dependencies..." 32 (cd ./services/site && yarn install --dev)