fix dups in $PATH with a backwards compatible solution

This commit is contained in:
Ben Harris 2019-04-02 00:17:02 -04:00
parent 1662945d9c
commit bcb5298353
1 changed files with 3 additions and 3 deletions

View File

@ -16,9 +16,9 @@ if test -d /usr/local/go
set -x GOPATH (/usr/local/go/bin/go env GOPATH)
end
set user_paths ~/bin /usr/local/go/bin ~/.yarn/bin $GOPATH/bin ~/.local/bin ~/.cargo/bin /snap/bin ~/.fzf/bin
for path in $user_paths
if test -d $path; and not echo $fish_user_paths | grep -q "$path"
set my_paths ~/bin /usr/local/go/bin ~/.yarn/bin $GOPATH/bin ~/.local/bin ~/.cargo/bin /snap/bin ~/.fzf/bin
for path in $my_paths
if test -d $path; and not echo $fish_user_paths | grep -q "$path"; and not echo $PATH | grep -q "$path"
set -x fish_user_paths $fish_user_paths $path
end
end