From 32e88beedc6fd8843f6c5b2660e23a72b0efefacf8448be2875b28f17096ec14 Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Sat, 22 Aug 2026 05:48:23 +0200 Subject: [PATCH] fix argument iteration --- install.sh | 2 +- pbc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index a95bcc5..b171d6c 100755 --- a/install.sh +++ b/install.sh @@ -15,7 +15,7 @@ function download_files() { local query_params='' [ -n "$GIT_TAG" ] && query_params="?ref=$GIT_TAG" - while [ -n "$1" ]; do + while (( $# > 0 )); do path=$1 shift curl -s --output-dir "$TMPDIR/" --remote-name "$API_ENDPOINT/raw/$path$query_params" diff --git a/pbc b/pbc index 5d08b45..8dc5ff9 100755 --- a/pbc +++ b/pbc @@ -164,7 +164,7 @@ function arr_contains() { local search=$1 shift [ -z "$search" ] && return 1 - while [ -n "$1" ]; do + while (( $# > 0 )); do [ "$1" == "$search" ] && return 0 shift done @@ -209,7 +209,7 @@ action='' cfgfile="$ETC_DIR/config" args=() -while [ -n "$1" ]; do +while (( $# > 0 )); do opt=$1 shift if [ -z "$action" ]; then