plugins/pyenv: use `_command_exists`

pull/1938/head
John D Pell 2021-09-19 21:54:44 -07:00
parent cff6f3464a
commit a31145335e
2 changed files with 6 additions and 2 deletions

View File

@ -90,6 +90,7 @@ plugins/available/history.plugin.bash
plugins/available/hub.plugin.bash
plugins/available/jump.plugin.bash
plugins/available/node.plugin.bash
plugins/available/pyenv.plugin.bash
plugins/available/rbenv.plugin.bash
plugins/available/textmate.plugin.bash
plugins/available/xterm.plugin.bash

View File

@ -1,10 +1,13 @@
# shellcheck shell=bash
cite about-plugin
about-plugin 'load pyenv, if you are using it'
export PYENV_ROOT="$HOME/.pyenv"
pathmunge "$PYENV_ROOT/bin"
[[ `which pyenv 2>/dev/null` ]] && eval "$(pyenv init - bash)"
if _command_exists pyenv; then
eval "$(pyenv init - bash)"
fi
#Load pyenv virtualenv if the virtualenv plugin is installed.
if pyenv virtualenv-init - &> /dev/null; then