diff --git a/etools b/etools index ae05fa8..52246f3 100644 --- a/etools +++ b/etools @@ -35,6 +35,7 @@ function etools_smart_find() { fi # unset helper functions ./helper.sh + unset _etools_packages } diff --git a/helper.sh b/helper.sh index e00eff6..2881ac9 100755 --- a/helper.sh +++ b/helper.sh @@ -33,11 +33,9 @@ function _formatted_find() { function _set_weights() { for package in "${!_etools_packages[@]}"; do # $function "$key" - echo iterated # TODO: figure out why this is not in scope - for regex in $package_weights; do - echo iterated inner - if [[ ${package//\"/} =~ *${regex}* ]]; then + for regex in ${!package_weights[@]}; do + if [[ ${package//\"/} =~ ^*${regex}*$ ]]; then _etools_packages[${package//\"/}]=${package_weights[$regex]} fi done @@ -78,7 +76,6 @@ function _filter() { # leave warning untils this is stable/fixed for function in \ _set_weights \ - _etools_print_assoc_array \ ${functions[@]}; do $function