Skip to content

Commit b0cfd45

Browse files
authored
Merge pull request #1409 from manics/terminal-no-set-e
`set -e` should not be set after conda environment is sourced
2 parents 374b8e5 + 12fc6dd commit b0cfd45

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

repo2docker/buildpacks/conda/activate-conda.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# enable conda and activate the notebook environment
2-
set -ex
2+
set -e
33
eval $(micromamba shell hook -s posix -r ${CONDA_DIR})
44
for name in conda mamba; do
55
CONDA_PROFILE="${CONDA_DIR}/etc/profile.d/${name}.sh"
@@ -21,3 +21,5 @@ if [[ "${KERNEL_PYTHON_PREFIX}" != "${NB_PYTHON_PREFIX}" ]]; then
2121
else
2222
mamba activate ${NB_PYTHON_PREFIX}
2323
fi
24+
25+
set +e

tests/venv/start/postBuild/README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ postBuild and start
33

44
This test checks that we can use a postBuild and start script
55
at the same time.
6+
7+
It also checks that exit on error (set -e) has not leaked into the main shell.

tests/venv/start/postBuild/verify

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
#!/bin/bash
1+
#!/bin/bash -il
2+
# Run this as an interactive login shell so that the conda profile is sourced
3+
4+
# Test that `set -e` isn't incorrectly set in a profile
5+
false
6+
27
set -euo pipefail
38
grep 'Done!' $HOME/postbuild.txt
49
# set value of TEST_START_VAR to empty string when it is not defined

0 commit comments

Comments
 (0)