clean up jenv to follow the newer pattern

pull/1644/head
cornfeedhobo 2020-07-30 07:50:35 -05:00
parent 43ef48544d
commit 6b66fbf88c
No known key found for this signature in database
GPG Key ID: 724357093F994B26
1 changed files with 18 additions and 3 deletions

View File

@ -1,7 +1,22 @@
cite about-plugin
about-plugin 'load jenv, if you are using it'
export JENV_ROOT="$HOME/.jenv"
# Don't modify the environment if we can't find the tool:
# - Check if in $PATH already
# - Check if installed manually to $JENV_ROOT
# - Check if installed manually to $HOME
_command_exists jenv ||
[[ -n "$JENV_ROOT" && -x "$JENV_ROOT/bin/jenv" ]] ||
[[ -x "$HOME/.jenv/bin/jenv" ]] ||
return
# Set JENV_ROOT, if not already set
export JENV_ROOT="${JENV_ROOT:-$HOME/.jenv}"
# Add JENV_ROOT/bin to PATH, if that's where it's installed
! _command_exists jenv &&
[[ -x "$JENV_ROOT/bin/jenv" ]] &&
pathmunge "$JENV_ROOT/bin"
if which jenv > /dev/null; then eval "$(jenv init - bash)"; fi
# Initialize jenv
eval "$(jenv init - bash)"