diff --git a/plugins/available/goenv.plugin.bash b/plugins/available/goenv.plugin.bash index 07e11f80..568e3e35 100644 --- a/plugins/available/goenv.plugin.bash +++ b/plugins/available/goenv.plugin.bash @@ -6,12 +6,12 @@ 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, adding to path if needbe -if ! _command_exists goenv && [ -n "${GOENV_ROOT}" ] && [ -x "${GOENV_ROOT}/bin/goenv" ] ; then +# If goenv not on path, but in GOENV_ROOT, then add to path +if ! _command_exists goenv && [ -x "${GOENV_ROOT}/bin/goenv" ] ; then pathmunge "${GOENV_ROOT}/bin" fi -# If we found the command, we're good to go +# If goenv on path, we're good to go if _command_exists goenv ; then # Now its safe to export the value export GOENV_ROOT