From 386be771d0c0d807ca3e668c99a5f8a53756871b Mon Sep 17 00:00:00 2001 From: Gandalf Date: Thu, 19 Mar 2026 20:26:24 -0300 Subject: [PATCH] fix: handle empty EXTRA_ARGS array in bash 3.2 (macOS default) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set -u with empty arrays throws 'unbound variable' on bash < 4.4. Use the conditional expansion form ${arr[@]+"${arr[@]}"} which expands to nothing when the array is empty, compatible with all bash versions. Fixes: https://github.com/LerianStudio/ring/issues (reported by Garzão) --- installer/install-ring.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/install-ring.sh b/installer/install-ring.sh index 5a1ebd5a..6997567f 100755 --- a/installer/install-ring.sh +++ b/installer/install-ring.sh @@ -182,7 +182,7 @@ if [[ "$dry_run" =~ ^[Yy]$ ]]; then echo "" echo "${YELLOW}=== Dry Run ===${RESET}" cd "$RING_ROOT" - "$PYTHON_CMD" -m installer.ring_installer install --platforms "$PLATFORMS" --dry-run "${EXTRA_ARGS[@]}" + "$PYTHON_CMD" -m installer.ring_installer install --platforms "$PLATFORMS" --dry-run "${EXTRA_ARGS[@]+"${EXTRA_ARGS[@]}"}" echo "" read -p "Proceed with actual installation? (Y/n): " proceed if [[ "$proceed" =~ ^[Nn]$ ]]; then @@ -195,7 +195,7 @@ fi echo "" echo "${GREEN}=== Installing ===${RESET}" cd "$RING_ROOT" -"$PYTHON_CMD" -m installer.ring_installer install --platforms "$PLATFORMS" "${EXTRA_ARGS[@]}" +"$PYTHON_CMD" -m installer.ring_installer install --platforms "$PLATFORMS" "${EXTRA_ARGS[@]+"${EXTRA_ARGS[@]}"}" echo "" echo "${GREEN}================================================${RESET}"