mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-02 06:45:00 +08:00
do not traverse completions directory
This commit is contained in:
parent
74e60036f1
commit
b0354ce36f
|
@ -84,13 +84,9 @@ function _prepend_tree -d "Add a dependency tree to the Fish path."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Null wildcard expansion will break the for loop even if $path is valid.
|
# Traverse $path prepending only directories with matches. Excludes completions folder.
|
||||||
# $subs will become an empty list for directories without sub directories
|
test -d $path
|
||||||
# which is safe to use in the loop.
|
and for dir in (find $path \! -name "completions" -type d)
|
||||||
set -l subs $path/**/
|
|
||||||
|
|
||||||
# Traverse $path and $subs prepending only directories with matches.
|
|
||||||
for dir in $path $subs
|
|
||||||
# Use head to retrieve at least one match. Skip not found errors
|
# Use head to retrieve at least one match. Skip not found errors
|
||||||
# for directories that do not exist.
|
# for directories that do not exist.
|
||||||
if [ -z (find "$dir" $glob -maxdepth 1 ^/dev/null | head -1) ]
|
if [ -z (find "$dir" $glob -maxdepth 1 ^/dev/null | head -1) ]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user