From bf492be2beb5251fc5dd0acbb6ed8f1acbb1c742 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" Date: Thu, 15 Oct 2026 22:59:25 +0100 Subject: [PATCH] fix(shell): use [[ ]] conditionals per SonarCloud bracket rule Converted 3 single-bracket conditional tests in scripts/check-lock-sync.sh to [[ ]]. Verified: bash -n clean; shellcheck -S warning delta zero new findings; standalone run result unchanged vs HEAD. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- scripts/check-lock-sync.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/check-lock-sync.sh b/scripts/check-lock-sync.sh index 5640769..67582cc 100755 --- a/scripts/check-lock-sync.sh +++ b/scripts/check-lock-sync.sh @@ -60,20 +60,20 @@ for cand in gawk awk; do AWK="$cand"; break fi done -if [ -z "$AWK" ]; then +if [[ -z "$AWK" ]]; then echo "check-lock-sync: FATAL: no awk supporting 3-argument match() (need gawk)" >&2 echo "check-lock-sync: install it with: sudo apt-get install -y gawk" >&2 exit 1 fi -if [ ! -f "$LOCK" ]; then +if [[ ! -f "$LOCK" ]]; then echo "check-lock-sync: FATAL: no lockfile at $LOCK" >&2 exit 1 fi shopt -s nullglob CANDIDATES=("$WF_DIR"/*.yml "$WF_DIR"/*.yaml) -if [ "${#CANDIDATES[@]}" -eq 0 ]; then +if [[ "${#CANDIDATES[@]}" -eq 0 ]]; then echo "check-lock-sync: FATAL: no workflow files under $WF_DIR" >&2 exit 1 fi