From 2d5ff793ad3e977bd7409c3a77ba1d1b3f0d33b6 Mon Sep 17 00:00:00 2001
From: rdanecek <danekradek@gmail.com>
Date: Mon, 13 Feb 2023 15:33:39 +0100
Subject: [PATCH] Exit install script if environment creation failed to avoid
 errouneously installing packages into the base env.

---
 install_38.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/install_38.sh b/install_38.sh
index bfce988f..74d02a3a 100755
--- a/install_38.sh
+++ b/install_38.sh
@@ -12,6 +12,13 @@ echo "Creating conda environment"
 mamba create -n work38 python=3.8 
 eval "$(conda shell.bash hook)" # make sure conda works in the shell script
 conda activate work38
+if echo $CONDA_PREFIX | grep work38
+then
+    echo "Conda environment successfully activated"
+else
+    echo "Conda environment not activated. Probably it was not created successfully for some reason. Please activate the conda environment before running this script"
+    exit
+fi
 echo "Installing conda packages"
 mamba env update -n work38 --file conda-environment_py38_cu11_ubuntu.yml 
 echo "Installing GDL"
-- 
GitLab