From 2bb7c587f400e90a06133b27f04e1ae2f6b2ca4c Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Fri, 26 Feb 2016 20:26:24 -0800 Subject: Skip over /etc/paths.d entries that don't exist I had an old /etc/paths.d/TeX file that listed a path /usr/texbin that doesn't exist anymore. This was causing the `set PATH` to print a warning. --- share/config.fish | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'share/config.fish') diff --git a/share/config.fish b/share/config.fish index d92e04d7..755cc23e 100644 --- a/share/config.fish +++ b/share/config.fish @@ -85,9 +85,11 @@ function __fish_load_path_helper_paths # Since we are prepending but want to preserve the order of the input file, we reverse the array, append, and then reverse it again set __fish_tmp_path $__fish_tmp_path[-1..1] while read -l new_path_comp - set -l where (contains -i $new_path_comp $__fish_tmp_path) - and set -e __fish_tmp_path[$where] - set __fish_tmp_path $new_path_comp $__fish_tmp_path + if test -d $new_path_comp + set -l where (contains -i $new_path_comp $__fish_tmp_path) + and set -e __fish_tmp_path[$where] + set __fish_tmp_path $new_path_comp $__fish_tmp_path + end end set __fish_tmp_path $__fish_tmp_path[-1..1] end -- cgit v1.2.3