From b767fa06bd2f8368fcb37bf39570a1e5103e6b2e 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 3088bbd..02c5e10 100755 --- a/scripts/check-lock-sync.sh +++ b/scripts/check-lock-sync.sh @@ -58,20 +58,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 mapfile -t WORKFLOWS < <(printf '%s\n' "$WF_DIR"/*.yml "$WF_DIR"/*.yaml | sort -u) -if [ "${#WORKFLOWS[@]}" -eq 0 ]; then +if [[ "${#WORKFLOWS[@]}" -eq 0 ]]; then echo "check-lock-sync: FATAL: no workflow files under $WF_DIR" >&2 exit 1 fi