mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
Make PATH validation only run for interactive shells to avoid infinite loop
darcs-hash:20060731003311-ac50b-da0b49830e5a9042fbe7952a63ced2c86b8978fe.gz
This commit is contained in:
parent
8a2846ed44
commit
2fba53b113
1 changed files with 12 additions and 10 deletions
|
@ -25,17 +25,19 @@ set __fish_help_dir @docdir@
|
||||||
# Make sure there are no invalid entries in the PATH
|
# Make sure there are no invalid entries in the PATH
|
||||||
#
|
#
|
||||||
|
|
||||||
set -l erase_idx
|
if status --is-interactive
|
||||||
for idx in (seq (count $PATH))
|
set -l erase_idx
|
||||||
set i $PATH[$idx]
|
for idx in (seq (count $PATH))
|
||||||
if not test -d $i
|
set i $PATH[$idx]
|
||||||
set erase_idx $erase_idx $idx
|
if not test -d $i
|
||||||
printf (_ '%s: Warning: The directory %s has been removed from your PATH because it does not exist\n') fish $i
|
set erase_idx $erase_idx $idx
|
||||||
end
|
printf (_ '%s: Warning: The directory %s has been removed from your PATH because it does not exist\n') fish $i
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if count $erase_idx >/dev/null
|
if count $erase_idx >/dev/null
|
||||||
set -e PATH[(echo $erase_idx)]
|
set -e PATH[(echo $erase_idx)]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue