Add goenv plugin

pull/1515/head
David Farrell 2020-03-09 11:32:58 -07:00
parent 2e53796d49
commit 73a21f7435
No known key found for this signature in database
GPG Key ID: 1CCA28D0E300B56F
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
cite about-plugin
about-plugin 'Init goenv, if installed. Plays nicely with package managers'
# Try to set GOENV_ROOT if not already set
if [ -z "${GOENV_ROOT}" ]; then
# Bail if cannot be set
if [ ! -d "$HOME/.goenv" ]; then
return
fi
export GOENV_ROOT="$HOME/.goenv"
fi
# Add GOENV_ROOT/bin to path if goenv not already on path
if ! _command_exists goenv && [ -x "${GOENV_ROOT}/bin/goenv" ]; then
pathmunge "$GOENV_ROOT/bin"
fi
# Initialize goenv - Play nicely if goenv not on path
if _command_exists goenv ; then
eval "$(goenv init - bash)"
fi