Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 546a977 + 0d70dcf commit bfc9a91Copy full SHA for bfc9a91
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