#!/bin/bash

prefix=$1
local_gribr=$2


if [[ -z $prefix ]]; then
  conda env create --file environment-cerise${local_gribr}.yml
else
  conda env create --file environment-cerise${local_gribr}.yml --prefix $prefix
fi
conda activate condaCerise
[[ -n ${local_gribr} ]] && module load ecCodes 

R -e "options(timeout = 600) ; install.packages('CSTools', repos='https://ftp.cixug.es/CRAN/')"
[[ -n ${local_gribr} ]] && R -e "options(timeout = 600) ; install.packages('conda_installation/gribr_1.2.5.tar.gz', repos = NULL)"
#conda env export > environment-cerise${local_gribr}.yml                                  
