Skip to content

Commit 6b298c6

Browse files
committed
only run deactivate if it exists
The deactivate command only exists if activate is run, but cleanup() might be called before activate is run if there is an error.
1 parent 17914a3 commit 6b298c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/build_test_env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ cleanup() {
5454
rm -f /tmp/python-gitlab.cfg
5555
docker kill gitlab-test >/dev/null 2>&1
5656
docker rm gitlab-test >/dev/null 2>&1
57-
deactivate || true
57+
command -v deactivate >/dev/null 2>&1 && deactivate || true
5858
rm -rf $VENV
5959
}
6060
[ -z "${BUILD_TEST_ENV_AUTO_CLEANUP+set}" ] || {

0 commit comments

Comments
 (0)