Skip to content

Commit 23b983b

Browse files
committed
refactor: improve performance find_files_recursive
1 parent 32c44ce commit 23b983b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/helpers.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ function helper::find_files_recursive() {
127127
local path="${1%%/}"
128128

129129
if [[ "$path" == *"*"* ]]; then
130-
eval find "$path" -type f -name '*[tT]est.sh' | sort | uniq
130+
eval find "$path" -type f -name '*[tT]est.sh' | sort -u
131131
elif [[ -d "$path" ]]; then
132-
find "$path" -type f -name '*[tT]est.sh' | sort | uniq
132+
find "$path" -type f -name '*[tT]est.sh' | sort -u
133133
else
134134
echo "$path"
135135
fi
@@ -201,7 +201,7 @@ function helpers::find_total_tests() {
201201
pattern+=".*$filter"
202202
fi
203203

204-
grep -r -E "$pattern" --include="*.sh" "${files[@]}" 2>/dev/null | wc -l | xargs
204+
grep -r -E "$pattern" --include="*[tT]est.sh" "${files[@]}" 2>/dev/null | wc -l | xargs
205205
}
206206

207207
function helper::load_test_files() {

0 commit comments

Comments
 (0)