minor improvements && cleanup

This commit is contained in:
fabolous005 2024-09-15 16:36:56 +02:00
parent 035ef798f6
commit d125ef59be
2 changed files with 8 additions and 3 deletions

View File

@ -10,6 +10,10 @@ fi
function _configure() {
# TODO: maybe fix this
# NOTE: setting options other than the defaults and reconfiguring works
# switching from custom options to defaults doesn't...
# Load config for shellcheck
# shellcheck source=/etc/etools/etools.conf
[ -f "/etc/etools/etools.conf" ] && . "/etc/etools/etools.conf"
@ -52,5 +56,5 @@ function _configure() {
ETOOLS_GREP_CMD=${ETOOLS_GREP_CMD:-"rg"}
ETOOLS_DEBUG=${ETOOLS_DEBUG:-:}
ETOOLS_DEBUG=${ETOOLS_DEBUG:-true}
}

View File

@ -23,13 +23,14 @@ function _formatted_find() {
# use wordsplitting
# shellcheck disable=SC2086
fd $ETOOLS_FIND_ARGS "${1}" "${2}"
[ "${ETOOLS_DEBUG}" ] && einfo fd "${1}" "${2}" "$ETOOLS_FIND_ARGS" >&2
[ "$ETOOLS_DEBUG" = "true" ] && einfo fd "${1}" "${2}" "$ETOOLS_FIND_ARGS" >&2
else
# shellcheck disable=SC2086
"$ETOOLS_FIND_CMD" "${2}" $ETOOLS_FIND_ARGS "${1}"
[ "${ETOOLS_DEBUG}" ] && einfo "${ETOOLS_FIND_CMD}" "${2}" "$ETOOLS_FIND_ARGS" "${1}" >&2
[ "$ETOOLS_DEBUG" = "true" ] && einfo "${ETOOLS_FIND_CMD}" "${2}" "$ETOOLS_FIND_ARGS" "${1}" >&2
fi
else
# TODO: do this with bash expansion only
eval '$(echo "${ETOOLS_FIND_COMMAND//\{repo\}/${2}}" | sed -e "s/{package}/${1}/g")'
fi
}