Simply pathmunge / bail logic
parent
dc2c9cfd38
commit
8c5581a52b
|
|
@ -6,20 +6,18 @@ about-plugin 'Init goenv, if installed. Plays nicely with package managers'
|
|||
# NOTE: We don't export it yet, since we might still bail
|
||||
GOENV_ROOT="${GOENV_ROOT:-${HOME}/.goenv}"
|
||||
|
||||
# Look for goenv command
|
||||
if ! _command_exists goenv ; then
|
||||
# Add it to the path if we find it, bail otherwise
|
||||
if [ -n "${GOENV_ROOT}" ] && [ -x "${GOENV_ROOT}/bin/goenv" ] ; then
|
||||
pathmunge "${GOENV_ROOT}/bin"
|
||||
else
|
||||
return
|
||||
fi
|
||||
# Look for goenv command, adding to path if needbe
|
||||
if ! _command_exists goenv && [ -n "${GOENV_ROOT}" ] && [ -x "${GOENV_ROOT}/bin/goenv" ] ; then
|
||||
pathmunge "${GOENV_ROOT}/bin"
|
||||
fi
|
||||
|
||||
# Since we didn't bail, export the value
|
||||
export GOENV_ROOT
|
||||
# If we found the command, we're good to go
|
||||
if _command_exists goenv ; then
|
||||
# Now its safe to export the value
|
||||
export GOENV_ROOT
|
||||
|
||||
# Initialize goenv
|
||||
# NOTE: In the off-chance that goenv has already been initialized,
|
||||
# it should be safe to re-initialize
|
||||
eval "$(goenv init - bash)"
|
||||
# Initialize goenv
|
||||
# NOTE: In the off-chance that goenv has already been initialized,
|
||||
# it should be safe to re-initialize
|
||||
eval "$(goenv init - bash)"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue