finish smart_find

This commit is contained in:
fabolous005 2024-09-13 20:53:14 +02:00
parent 15f36caa5f
commit ee614d2c2a
2 changed files with 3 additions and 5 deletions

1
etools
View File

@ -35,6 +35,7 @@ function etools_smart_find() {
fi fi
# unset helper functions # unset helper functions
./helper.sh ./helper.sh
unset _etools_packages
} }

View File

@ -33,11 +33,9 @@ function _formatted_find() {
function _set_weights() { function _set_weights() {
for package in "${!_etools_packages[@]}"; do for package in "${!_etools_packages[@]}"; do
# $function "$key" # $function "$key"
echo iterated
# TODO: figure out why this is not in scope # TODO: figure out why this is not in scope
for regex in $package_weights; do for regex in ${!package_weights[@]}; do
echo iterated inner if [[ ${package//\"/} =~ ^*${regex}*$ ]]; then
if [[ ${package//\"/} =~ *${regex}* ]]; then
_etools_packages[${package//\"/}]=${package_weights[$regex]} _etools_packages[${package//\"/}]=${package_weights[$regex]}
fi fi
done done
@ -78,7 +76,6 @@ function _filter() {
# leave warning untils this is stable/fixed # leave warning untils this is stable/fixed
for function in \ for function in \
_set_weights \ _set_weights \
_etools_print_assoc_array \
${functions[@]}; ${functions[@]};
do do
$function $function