File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed
repo2docker/buildpacks/conda Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change 1
- # enable conda and activate the notebook environment
2
- set -e
1
+ set -ex
2
+
3
+ # Setup conda
4
+ CONDA_PROFILE=" ${CONDA_DIR} /etc/profile.d/conda.sh"
5
+ echo " Activating profile: ${CONDA_PROFILE} "
6
+ test -f $CONDA_PROFILE && . $CONDA_PROFILE
7
+
8
+ # Setup micromamba
3
9
eval $( micromamba shell hook -s posix -r ${CONDA_DIR} )
4
- for name in conda mamba; do
5
- CONDA_PROFILE=" ${CONDA_DIR} /etc/profile.d/${name} .sh"
6
- echo " Activating profile: ${CONDA_PROFILE} "
7
- test -f $CONDA_PROFILE && . $CONDA_PROFILE
8
- done
10
+
11
+ # Setup mamba
12
+ export MAMBA_ROOT_PREFIX=" ${CONDA_DIR} "
13
+ __mamba_setup=" $( " ${CONDA_DIR} /bin/mamba" shell hook --shell posix 2> /dev/null) "
14
+ if [ $? -eq 0 ]; then
15
+ eval " $__mamba_setup "
16
+ else
17
+ alias mamba=" ${CONDA_DIR} /bin/mamba" # Fallback on help from mamba activate
18
+ fi
19
+ unset __mamba_setup
20
+
21
+ # Activate the environment
9
22
if [[ " ${KERNEL_PYTHON_PREFIX} " != " ${NB_PYTHON_PREFIX} " ]]; then
10
23
# if the kernel is a separate env, stack them
11
24
# so both are on PATH, notebook first
22
35
mamba activate ${NB_PYTHON_PREFIX}
23
36
fi
24
37
25
- set +e
38
+ set +ex
You can’t perform that action at this time.
0 commit comments