changeset 131:5f6e4aa53501

Let Conda activation use the local directory as a name
author IBBoard <dev@ibboard.co.uk>
date Tue, 26 Nov 2019 10:35:23 +0000
parents 9d522c13ec68
children b3da56c746b3
files bashrc
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/bashrc	Tue Oct 29 16:49:15 2019 +0000
+++ b/bashrc	Tue Nov 26 10:35:23 2019 +0000
@@ -88,4 +88,14 @@
         fi
     fi
     unset __conda_setup
+
+    if [ $# -eq 1 ]; then
+    	if [ "x$1" == "x." ]; then
+    		_conda_env=$(basename $(readlink -f .))
+    	else
+    		_conda_env=$1
+    	fi
+    	conda activate $_conda_env
+    fi
+    unset _conda_env
 }
\ No newline at end of file