mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-25 23:21:15 -03:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user