Fix goenv plugin

pull/1528/head
David Farrell 2020-03-25 11:29:12 -07:00
parent 52123d5072
commit f52453c643
No known key found for this signature in database
GPG Key ID: 1CCA28D0E300B56F
1 changed files with 3 additions and 1 deletions

View File

@ -3,8 +3,10 @@ about-plugin 'load goenv, if you are using it'
# Don't modify the environment if we can't find the tool: # Don't modify the environment if we can't find the tool:
# - Check if in $PATH already # - Check if in $PATH already
# - Check if installed manually to $GOENV_ROOT
# - Check if installed manually to $HOME # - Check if installed manually to $HOME
_command_exists goenv || _command_exists goenv ||
[[ -n "$GOENV_ROOT" && -x "$GOENV_ROOT/bin/goenv" ]] ||
[[ -x "$HOME/.goenv/bin/goenv" ]] || [[ -x "$HOME/.goenv/bin/goenv" ]] ||
return return
@ -12,7 +14,7 @@ _command_exists goenv ||
export GOENV_ROOT="${GOENV_ROOT:-$HOME/.goenv}" export GOENV_ROOT="${GOENV_ROOT:-$HOME/.goenv}"
# Add GOENV_ROOT/bin to PATH, if that's where it's installed # Add GOENV_ROOT/bin to PATH, if that's where it's installed
[[ -x "$HOME/.goenv/bin/goenv" ]] && pathmunge "$GOENV_ROOT/bin" ! _command_exists goenv && [[ -x "$GOENV_ROOT/bin/goenv" ]] && pathmunge "$GOENV_ROOT/bin"
# Initialize goenv # Initialize goenv
eval "$(goenv init - bash)" eval "$(goenv init - bash)"