Display information on automatic (de)?activation

This commit is contained in:
Yamashita Yuu
2014-07-04 22:26:55 +09:00
parent 58ed045796
commit d4ce853e94
6 changed files with 129 additions and 55 deletions

View File

@@ -10,11 +10,22 @@ set -e
[ -n "$PYENV_DEBUG" ] && set -x
unset NOERROR
unset VERBOSE
if [ "$1" = "--no-error" ]; then
NOERROR=1
while [ $# -gt 0 ]; do
case "$1" in
"--no-error" )
NOERROR=1
;;
"--verbose" )
VERBOSE=1
;;
* )
break
;;
esac
shift 1
fi
done
shell="$(basename "${PYENV_SHELL:-$SHELL}")"
case "$shell" in
@@ -26,6 +37,10 @@ fish )
;;
esac
if [ -n "$VERBOSE" ]; then
echo " echo \"pyenv-virtualenv: deactivate ${VIRTUAL_ENV##*/}\" 1>&2;"
fi
if [ -z "${PYENV_VIRTUALENV_INIT}" ]; then
# Backward compatibility issue
# https://github.com/yyuu/pyenv-virtualenv/issues/26
@@ -35,14 +50,14 @@ fi
case "$shell" in
fish )
cat <<EOS
setenv PYENV_DEACTIVATE "\$VIRTUAL_ENV";
setenv PYENV_DEACTIVATE "$VIRTUAL_ENV";
deactivate;
else;
EOS
;;
* )
cat <<EOS
export PYENV_DEACTIVATE="\$VIRTUAL_ENV";
export PYENV_DEACTIVATE="$VIRTUAL_ENV";
deactivate;
else
EOS