diff --git a/setup_env.sh b/setup_env.sh index 11e6d83..bb41046 100644 --- a/setup_env.sh +++ b/setup_env.sh @@ -1,6 +1,29 @@ -#!/bin/bash +#! /bin/bash -conda env create -n bootcamp -f env.yml # runtime: ~13min -~/.conda/envs/bootcamp/bin/python3 -m ipykernel install --user --name=python_bootcamp --display-name="Python 3 (bootcamp)" -Rscript -e 'IRkernel::installspec(name="R_bootcamp", displayname="R (bootcamp)")' +set -eu +if [ ! -e "$HOME/Miniforge3-Linux-x86_64.sh" ]; then + wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -P $HOME +fi + +if [ ! -e "$HOME/miniforge3" ]; then + bash $HOME/Miniforge3-Linux-x86_64.sh -b +fi + +export PATH="$HOME/miniforge3/bin:$PATH" + +mamba env create -f env.yml -y +mamba run -n bootcamp ipython kernel install --user --name=python_bootcamp --display-name="Python 3 (bootcamp)" +mamba run -n bootcamp Rscript -e 'IRkernel::installspec(name="R_bootcamp", displayname="R (bootcamp)")' + +mamba init +source ~/.bashrc + +touch ~/.bash_profile +cat >> ~/.bash_profile << EOF +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi +EOF + +rm ~/Miniforge3-Linux-x86_64.sh