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.
1 parent 23032cb commit 5d09a90Copy full SHA for 5d09a90
src/virtualenv/activation/bash/activate.sh
@@ -56,7 +56,15 @@ deactivate () {
56
# unset irrelevant variables
57
deactivate nondestructive
58
59
-VIRTUAL_ENV=__VIRTUAL_ENV__
+if [ ! -d __VIRTUAL_ENV__ ]; then
60
+ echo "Virtual environment directory __VIRTUAL_ENV__ does not exist!" >&2
61
+ CURRENT_PATH=$(realpath "${0}")
62
+ CURRENT_DIR=$(dirname "${CURRENT_PATH}")
63
+ VIRTUAL_ENV="$(realpath "${CURRENT_DIR}/../")"
64
+else
65
+ VIRTUAL_ENV=__VIRTUAL_ENV__
66
+fi
67
+
68
if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then
69
VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV")
70
fi
0 commit comments