From 1e3c575b7e32e762d4770b66585efc7215ccd0c8 Mon Sep 17 00:00:00 2001 From: David Laub <60826163+d-laub@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:31:41 -0700 Subject: [PATCH] Update setup_env.sh --- setup_env.sh | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) 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