mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
Make path checking on startup faster by only using builtin commands
darcs-hash:20070928213821-75c98-65fb9e2159bfef7ab04468511378ac3efbf2308e.gz
This commit is contained in:
parent
3a73b60956
commit
db0a982570
@ -62,14 +62,11 @@ switch $USER
|
||||
set path_list $path_list /sbin /usr/sbin /usr/local/sbin
|
||||
end
|
||||
|
||||
# Make a regular expression that matches any component in the PATH. A
|
||||
# trailing slash is ok. The sed call is to remove the last '|'.
|
||||
set -l tmp (printf "%s" \^$PATH'/?$|')
|
||||
set -l path_regexp \((echo $tmp | sed -e "s/.\$//")\)
|
||||
|
||||
for i in (printf "%s\n" $path_list|sgrep -E -v $path_regexp)
|
||||
if test -d $i
|
||||
set PATH $PATH $i
|
||||
for i in $path_list
|
||||
if not contains $i $PATH
|
||||
if test -d $i
|
||||
set PATH $PATH $i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user