From 30b6a09bc345df632a4c8c8e68c46c6af424ef26 Mon Sep 17 00:00:00 2001 From: Klaijan Date: Fri, 8 Mar 2024 17:09:55 +0700 Subject: [PATCH] fix: declare -i [SC2324 shellcheck] (#2624) Fix SC2324 shellcheck warning by adding -i to indicate var type of integer and tidy up the formatting. --- scripts/version-sync.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/version-sync.sh b/scripts/version-sync.sh index 2a30bb5eb..6ee672876 100755 --- a/scripts/version-sync.sh +++ b/scripts/version-sync.sh @@ -16,12 +16,12 @@ function usage { } function getopts-extra() { - declare i=1 + declare -i i=1 # if the next argument is not an option, then append it to array OPTARG while [[ ${OPTIND} -le $# && ${!OPTIND:0:1} != '-' ]]; do OPTARG[i]=${!OPTIND} - i+=1 - OPTIND+=1 + ((i += 1)) + ((OPTIND += 1)) done }