We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2787818 commit 0d70dcfCopy full SHA for 0d70dcf
conda_auto_env.sh
@@ -0,0 +1,16 @@
1
+# Modified from:
2
+# https://github.com/chdoig/conda-auto-env
3
+
4
+# Auto activate conda environments
5
+function conda_auto_env() {
6
+ if [ -e "environment.yaml" ]; then
7
+ ENV_NAME=$(head -n 1 environment.yaml | cut -f2 -d ' ')
8
+ # Check if you are already in the environment
9
+ if [[ $CONDA_PREFIX != *$ENV_NAME* ]]; then
10
+ # Try to activate environment
11
+ source activate $ENV_NAME &>/dev/null
12
+ fi
13
14
+}
15
16
+export PROMPT_COMMAND="conda_auto_env;$PROMPT_COMMAND"
0 commit comments