Commit 48755767 authored by Jorge Bucaran's avatar Jorge Bucaran

Do not add test/spec files to function path via skip glob in `import`.

parent 912315ba
...@@ -102,11 +102,6 @@ function _prepend_tree -d "Add a dependency tree to the Fish path." ...@@ -102,11 +102,6 @@ function _prepend_tree -d "Add a dependency tree to the Fish path."
printf "%s\n" $dir printf "%s\n" $dir
end end
# Do not add test/spec files to function path.
if contains -- (basename $dir) "test" "tests" "spec"
continue
end
# Prepend matched directory to the the global fish function path. # Prepend matched directory to the the global fish function path.
# Note path duplicates are already handled by _prepend_path. # Note path duplicates are already handled by _prepend_path.
_prepend_path $dir -d fish_function_path _prepend_path $dir -d fish_function_path
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
# NOTES # NOTES
# $fish_path and $fish_custom point to oh-my-fish home and the user # $fish_path and $fish_custom point to oh-my-fish home and the user
# dotfiles folder respectively. Both globals are usually configured # dotfiles folder respectively. Both globals are usually configured
# in ~/.config/fish/config.fish # in ~/.config/fish/config.fish. Also, import is clever enough to
# skip directories with *.spec.fish files.
# #
# EXAMPLES # EXAMPLES
# import plugins/<plugin> # import plugins/<plugin>
...@@ -25,14 +26,17 @@ ...@@ -25,14 +26,17 @@
# functions/_prepend_path.fish # functions/_prepend_path.fish
# functions/_prepend_tree.fish # functions/_prepend_tree.fish
# #
# v.0.1.0 # v.0.1.1
#/ #/
function import -d "Load libraries, plugins, themes, etc." function import -d "Load libraries, plugins, themes, etc."
# Do not add spec files to function path.
set -l skip_spec \*.fish -a ! \*.spec.fish
for library in $argv for library in $argv
# Prepend plugins, themes and completions, traversing library # Prepend plugins, themes and completions, traversing library
# trees and prepending directories with fish code. # trees and prepending directories with fish code.
_prepend_tree $fish_path/$library _prepend_tree $fish_path/$library $skip_spec
_prepend_tree $fish_custom/$library _prepend_tree $fish_custom/$library $skip_spec
_prepend_path $fish_path/$library/completions -d fish_complete_path _prepend_path $fish_path/$library/completions -d fish_complete_path
# Set path to load files. # Set path to load files.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment