diff --git a/README.md b/README.md index ea739f39..ab5ded5f 100644 --- a/README.md +++ b/README.md @@ -317,14 +317,14 @@ See [Advanced configuration](#advanced-configuration) for details and more confi * to add to `~/.bash_profile`: ~~~ bash echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile - echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile + echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(pyenv init -)"' >> ~/.bash_profile ~~~ - For **Zsh**: ~~~ zsh echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc - echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc + echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc echo 'eval "$(pyenv init -)"' >> ~/.zshrc ~~~ diff --git a/libexec/pyenv-init b/libexec/pyenv-init index c1e0da7b..5ce275e1 100755 --- a/libexec/pyenv-init +++ b/libexec/pyenv-init @@ -165,7 +165,7 @@ function help_() { fi echo echo 'export PYENV_ROOT="$HOME/.pyenv"' - echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' + echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' echo 'eval "$(pyenv init -)"' ;; esac