diff options
| author | 2026-05-20 14:01:04 +0100 | |
|---|---|---|
| committer | 2026-05-20 14:01:04 +0100 | |
| commit | d90f59f78b7312da3ed55738a1d2fa11baa78843 (patch) | |
| tree | 880768c717d8aeafbc7b2202d0a2c37f203dcdce /dot_config/waybar/executable_dock-status.sh | |
| parent | 5b8bda580414d214f6156abe9ab66963ed6614f0 (diff) | |
| download | dotfiles-d90f59f78b7312da3ed55738a1d2fa11baa78843.tar.gz dotfiles-d90f59f78b7312da3ed55738a1d2fa11baa78843.tar.bz2 dotfiles-d90f59f78b7312da3ed55738a1d2fa11baa78843.zip | |
fix(waybar): refactor A && B || C patterns to avoid shellcheck SC2015
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.
Diffstat (limited to 'dot_config/waybar/executable_dock-status.sh')
| -rw-r--r-- | dot_config/waybar/executable_dock-status.sh | 3 |
1 files changed, 2 insertions, 1 deletions
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 |
