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:
Yamashita, Yuu
2015-11-23 12:28:10 +00:00
parent f92a3a26c5
commit 5f87786adf
8 changed files with 33 additions and 74 deletions

View File

@@ -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