Skip to content

Commit

Permalink
Clean up PATH manipulation
Browse files Browse the repository at this point in the history
Only add `FZF_PLUGIN_BIN` to `$PATH` when it isn't already there.

Signed-off-by: Joe Block <[email protected]>
  • Loading branch information
unixorn committed Mar 5, 2024
1 parent 480cbd0 commit 2343b83
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fzf-zsh-plugin.plugin.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020-2023 Joseph Block <[email protected]>
# Copyright 2020-2024 Joseph Block <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,9 @@

# Add our plugin's bin directory to the user's path
local FZF_PLUGIN_BIN="$(dirname $0)/bin"
path+=(${FZF_PLUGIN_BIN})
if [[ ! "$path" == *${FZF_PLUGIN_BIN}* ]]; then
path+=(${FZF_PLUGIN_BIN})
fi
unset FZF_PLUGIN_BIN

local FZF_COMPLETIONS_D="$(dirname $0)/completions"
Expand Down

0 comments on commit 2343b83

Please sign in to comment.