From bb10c979ef22b2c5242dc0348b3ea3a1bf9b731d Mon Sep 17 00:00:00 2001 From: Jason Pickens Date: Wed, 20 Nov 2019 19:05:16 +0200 Subject: [PATCH] jenv: only add to PATH if not already on it (#8414) This prevents the jenv plugin from messing up the PATH and putting `user/local/bin` back at the front of the PATH, undoing any careful setup done before enabling this plugin. --- plugins/jenv/jenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jenv/jenv.plugin.zsh b/plugins/jenv/jenv.plugin.zsh index 2eda8037b..b85906a0b 100644 --- a/plugins/jenv/jenv.plugin.zsh +++ b/plugins/jenv/jenv.plugin.zsh @@ -15,7 +15,7 @@ if [[ $FOUND_JENV -eq 0 ]]; then fi if [[ $FOUND_JENV -eq 1 ]]; then - export PATH="${jenvdir}/bin:$PATH" + (( $+commands[jenv] )) || export PATH="${jenvdir}/bin:$PATH" eval "$(jenv init - zsh)" function jenv_prompt_info() { jenv version-name 2>/dev/null }