From bcb5298353d68db6ebd4293d7b917e2be163e3c9 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 2 Apr 2019 00:17:02 -0400 Subject: [PATCH] fix dups in $PATH with a backwards compatible solution --- fish/.config/fish/config.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index a04be7a..b1baa18 100755 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -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