unixorn/fzf-zsh-plugin

Add path check before adding to user path

Closed this issue · 1 comments

I am currently tweaking my zsh config, and in turn sourcing my .zshrc quite often, and I noticed the path to this plugins bin directory is being added multiple times to my PATH variable. I took a quick look, and I think there should be a check for if the bin path is already present on the user path before adding it to the users PATH variable. I believe this line:

path+=(${FZF_PLUGIN_BIN})

should be wrapped with a check, something like this:

if [[ ! "$path" == *${FZF_PLUGIN_BIN}* ]]; then
  path+=(${FZF_PLUGIN_BIN})
fi

TIL, I'll have to update my other plugins too.