From d90f59f78b7312da3ed55738a1d2fa11baa78843 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 20 May 2026 14:01:04 +0100 Subject: fix(waybar): refactor A && B || C patterns to avoid shellcheck SC2015 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Older shellcheck (Ubuntu's in CI) flags '[ test ] && cmd || true' as SC2015 because, despite the intent, A && B || C is not equivalent to if-then-else (C runs when A is true but B fails). Replace with explicit 'if … fi' or split into two 'A || continue' guards. Functionally identical, lint-clean across versions. --- dot_config/waybar/executable_dock-status.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dot_config/waybar/executable_dock-status.sh') diff --git a/dot_config/waybar/executable_dock-status.sh b/dot_config/waybar/executable_dock-status.sh index a85950d..b8093fb 100644 --- a/dot_config/waybar/executable_dock-status.sh +++ b/dot_config/waybar/executable_dock-status.sh @@ -11,7 +11,8 @@ set -eu docked=0 for dev in /sys/bus/usb/devices/*/; do - [ -f "$dev/idVendor" ] && [ -f "$dev/idProduct" ] || continue + [ -f "$dev/idVendor" ] || continue + [ -f "$dev/idProduct" ] || continue v=$(cat "$dev/idVendor") p=$(cat "$dev/idProduct") if [ "$v" = "17ef" ] && [ "$p" = "a387" ]; then -- cgit v1.3.1