Skip to content

Commit 1ee7ca6

Browse files
authored
Fix unbound variable errors when running pyenv activate with set -u (#423)
1 parent 91609e2 commit 1ee7ca6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/pyenv-sh-deactivate

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ EOS
134134
;;
135135
* )
136136
cat <<EOS
137-
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
137+
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
138138
export PATH="\${_OLD_VIRTUAL_PATH}";
139139
unset _OLD_VIRTUAL_PATH;
140140
fi;
@@ -153,7 +153,7 @@ EOS
153153
;;
154154
* )
155155
cat <<EOS
156-
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
156+
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
157157
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
158158
unset _OLD_VIRTUAL_PYTHONHOME;
159159
fi;
@@ -167,7 +167,7 @@ fish )
167167
;;
168168
* )
169169
cat <<EOS
170-
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
170+
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
171171
export PS1="\${_OLD_VIRTUAL_PS1}";
172172
unset _OLD_VIRTUAL_PS1;
173173
fi;

0 commit comments

Comments
 (0)