Skip empty detectors

Without this patch, output had ugly messages

    Usage: grep [OPTION]... PATTERNS [FILE]...
    Try 'grep --help' for more information.

and with the patch, the rule file is more readable
because it omits

-# Logitech Powerplay Mat -
-#---------------------------------------------------------------#
-#---------------------------------------------------------------#

-# Quantum Mechanical Keyboard (QMK) -
-#---------------------------------------------------------------#
-#---------------------------------------------------------------#
This commit is contained in:
Bernhard M. Wiedemann 2023-10-19 15:40:46 +02:00 committed by Adam Honse
parent a7920c01d7
commit 9ac44192bc

View file

@ -80,7 +80,7 @@ do
type=$(printf %s "$DATA" | grep @type | sed -e 's/@type//g' -e 's/^ *//g')
detectors=$(printf %s "$DATA" | grep @detectors | sed -e 's/@detectors *//g' -e 's/^ *//g' -e 's/\,/\n/g')
if [[ $type = USB || $type = Serial ]]; then #Check that the type is USB
if [[ -n "$detectors" ]] && [[ $type = USB || $type = Serial ]]; then #Check that the type is USB
## Iterate over the comma seperated detector function list
while read -r detector
do