mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08: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:
parent
2187c0a84b
commit
2bb7c587f4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user