From 912315ba692661659a479546eb0dfbda74c9deec Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Wed, 14 Jan 2015 02:50:08 +0900 Subject: [PATCH] Do not add test/spec files to function path in _prepend_tree. --- functions/_prepend_tree.fish | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/functions/_prepend_tree.fish b/functions/_prepend_tree.fish index fc6d177..7bf1e69 100644 --- a/functions/_prepend_tree.fish +++ b/functions/_prepend_tree.fish @@ -102,6 +102,11 @@ function _prepend_tree -d "Add a dependency tree to the Fish path." printf "%s\n" $dir 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. # Note path duplicates are already handled by _prepend_path. _prepend_path $dir -d fish_function_path