mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-13 22:13:52 -05:00
Fix errors when set -u is set in the user's shell (#350)
This commit is contained in:
@@ -129,7 +129,7 @@ esac
|
||||
if [[ "$shell" != "fish" ]]; then
|
||||
cat <<EOS
|
||||
local ret=\$?
|
||||
if [ -n "\$VIRTUAL_ENV" ]; then
|
||||
if [ -n "\${VIRTUAL_ENV-}" ]; then
|
||||
eval "\$(pyenv sh-activate --quiet || pyenv sh-deactivate --quiet || true)" || true
|
||||
else
|
||||
eval "\$(pyenv sh-activate --quiet || true)" || true
|
||||
@@ -141,8 +141,8 @@ EOS
|
||||
case "$shell" in
|
||||
bash )
|
||||
cat <<EOS
|
||||
if ! [[ "\$PROMPT_COMMAND" =~ _pyenv_virtualenv_hook ]]; then
|
||||
PROMPT_COMMAND="_pyenv_virtualenv_hook;\$PROMPT_COMMAND";
|
||||
if ! [[ "\${PROMPT_COMMAND-}" =~ _pyenv_virtualenv_hook ]]; then
|
||||
PROMPT_COMMAND="_pyenv_virtualenv_hook;\${PROMPT_COMMAND-}"
|
||||
fi
|
||||
EOS
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user