mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-17 16:03:42 -05:00
Remove PYENV_DEACTIVATE (fixes #121)
This means that pyenv-virtualenv will not allow manual deactivation of virtualenv if pyenv-virtualenv-init is enabled. This must be acceptable since the activation of virtualenv is just setting of environment variables in current implementation.
This commit is contained in:
@@ -32,11 +32,13 @@ while [ $# -gt 0 ]; do
|
||||
done
|
||||
|
||||
if [ -z "${VIRTUAL_ENV}" ]; then
|
||||
if [ -z "$QUIET" ]; then
|
||||
echo "pyenv-virtualenv: no virtualenv has been activated." 1>&2
|
||||
if [ -z "${FORCE}" ]; then
|
||||
if [ -z "${QUIET}" ]; then
|
||||
echo "pyenv-virtualenv: no virtualenv has been activated." 1>&2
|
||||
fi
|
||||
echo "false"
|
||||
exit 1
|
||||
fi
|
||||
echo "false"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
shell="$(basename "${PYENV_SHELL:-$SHELL}")"
|
||||
@@ -72,20 +74,13 @@ fi
|
||||
# virtualenv/pyvenv
|
||||
case "${shell}" in
|
||||
fish )
|
||||
cat <<EOS
|
||||
setenv PYENV_DEACTIVATE "${VIRTUAL_ENV}";
|
||||
set -e VIRTUAL_ENV;
|
||||
EOS
|
||||
echo "set -e VIRTUAL_ENV;"
|
||||
;;
|
||||
* )
|
||||
cat <<EOS
|
||||
export PYENV_DEACTIVATE="${VIRTUAL_ENV}";
|
||||
unset VIRTUAL_ENV;
|
||||
EOS
|
||||
echo "unset VIRTUAL_ENV;"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# anaconda/miniconda
|
||||
if [ -n "${CONDA_DEFAULT_ENV}" ]; then
|
||||
case "${shell}" in
|
||||
|
||||
Reference in New Issue
Block a user