From 9ac44192bc1319be6d82d0de4b26cb9c33138990 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Thu, 19 Oct 2023 15:40:46 +0200 Subject: [PATCH] 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) - -#---------------------------------------------------------------# -#---------------------------------------------------------------# --- scripts/build-udev-rules.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-udev-rules.sh b/scripts/build-udev-rules.sh index 993a463f..a30dc8e5 100755 --- a/scripts/build-udev-rules.sh +++ b/scripts/build-udev-rules.sh @@ -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