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:
parent
a7920c01d7
commit
9ac44192bc
1 changed files with 1 additions and 1 deletions
|
|
@ -80,7 +80,7 @@ do
|
||||||
type=$(printf %s "$DATA" | grep @type | sed -e 's/@type//g' -e 's/^ *//g')
|
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')
|
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
|
## Iterate over the comma seperated detector function list
|
||||||
while read -r detector
|
while read -r detector
|
||||||
do
|
do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue