From 6e5244d158d3f020e1ddf788060a929435fa3eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 22 Apr 2018 19:53:34 +0200 Subject: [PATCH] Use more idiomatic check for commands --- plugins/pyenv/pyenv.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index 0d2a2b018..76880e415 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -1,9 +1,9 @@ # This plugin loads pyenv into the current shell and provides prompt info via # the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available. -if which pyenv > /dev/null; then +if (( $+commands[pyenv] )); then eval "$(pyenv init - zsh)" - if which pyenv-virtualenv-init > /dev/null; then + if (( $+commands[pyenv-virtualenv-init] )); then eval "$(pyenv virtualenv-init - zsh)" fi function pyenv_prompt_info() {