-
Notifications
You must be signed in to change notification settings - Fork 2
/
cactivate
22 lines (18 loc) · 827 Bytes
/
cactivate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
#
# Replacement for conda's "activate" file, that instead starts a subshell
# for the new environment.
# Location of this hardcoded for now. If this became standard conda practice,
# it could be replaced with `conda info --root`/bash_condarc
BASH_CONDARC="$HOME/dev/copip/bash_condarc"
_CONDA_ENV_NAME=${1-root}
# We are going to transfer control to a new subshell, so that getting back to
# the previous envirionment is possible just by exiting the subshell. The
# subshell will then call "source activate" within it.
#
# We set the name of the new conda env so we can call "source activate $ENV"
# correctly, preserving compatibility with how conda currently works.
export _CONDA_ENV_NAME
echo "*** Starting sub-shell for conda env: $_CONDA_ENV_NAME"
bash --rcfile $BASH_CONDARC
unset _CONDA_ENV_NAME