mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2026-09-15 01:36:25 -04:00
Use typeset -g with precmd_functions
This makes it possible to use `eval "$(pyenv virtualenv-init -)"` from a function.
This commit is contained in:
parent
32e5a73345
commit
2ab9483116
|
|
@ -144,7 +144,7 @@ EOS
|
|||
;;
|
||||
zsh )
|
||||
cat <<EOS
|
||||
typeset -a precmd_functions
|
||||
typeset -g -a precmd_functions
|
||||
if [[ -z \$precmd_functions[(r)_pyenv_virtualenv_hook] ]]; then
|
||||
precmd_functions+=_pyenv_virtualenv_hook;
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ _pyenv_virtualenv_hook() {
|
|||
fi
|
||||
fi
|
||||
};
|
||||
typeset -a precmd_functions
|
||||
typeset -g -a precmd_functions
|
||||
if [[ -z \$precmd_functions[(r)_pyenv_virtualenv_hook] ]]; then
|
||||
precmd_functions+=_pyenv_virtualenv_hook;
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue