fix: allow combining include and exclude

Signed-off-by: wilmardo <info@wilmardenouden.nl>
This commit is contained in:
wilmardo 2019-12-04 15:21:37 +01:00
parent c35d71f533
commit 1b37a1e6bc

View file

@ -144,7 +144,15 @@ main () {
else
for i in $(echo "$check" | sed "s/,/ /g"); do
if command -v "$i" 2>/dev/null 1>&2; then
if [ "$checkexclude" ]; then
checkexcluded="$(echo ",$checkexclude" | sed -e 's/^/\^/g' -e 's/,/\$|/g' -e 's/$/\$/g')"
included_checks=$(sed -ne "/$i() {/,/}/{/check/p}" functions_lib.sh | grep -vE "$checkexcluded")
for check in $included_checks; do
"$check"
done
else
"$i"
fi
else
echo "Check \"$i\" doesn't seem to exist."
continue