Disable shellcheck in usplit
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
The local variables aren't picked up by shellcheck because of the printf level of indirection I do later in the function, which is the reason /why/ I use a variable in the first argument to printf.
This commit is contained in:
parent
7166fed540
commit
83af2d5cd7
13
bollux
13
bollux
|
@ -223,11 +223,12 @@ usplit() { # usplit NAME:ARRAY URL:STRING
|
|||
local re='^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?'
|
||||
[[ $2 =~ $re ]] || return $?
|
||||
|
||||
local scheme="${BASH_REMATCH[2]}"
|
||||
local authority="${BASH_REMATCH[4]}"
|
||||
local path="${BASH_REMATCH[5]}"
|
||||
local query="${BASH_REMATCH[7]}"
|
||||
local fragment="${BASH_REMATCH[9]}"
|
||||
# shellcheck disable=2034
|
||||
local scheme="${BASH_REMATCH[2]}" \
|
||||
authority="${BASH_REMATCH[4]}" \
|
||||
path="${BASH_REMATCH[5]}" \
|
||||
query="${BASH_REMATCH[7]}" \
|
||||
fragment="${BASH_REMATCH[9]}"
|
||||
|
||||
# 0=url 1=scheme 2=authority 3=path 4=query 5=fragment
|
||||
local i=1 c
|
||||
|
@ -235,10 +236,12 @@ usplit() { # usplit NAME:ARRAY URL:STRING
|
|||
if [[ "${!c}" || "$c" == path ]]; then
|
||||
printf -v "$1[$i]" '%s' "${!c}"
|
||||
else
|
||||
# shellcheck disable=2059
|
||||
printf -v "$1[$i]" "$UC_BLANK"
|
||||
fi
|
||||
((i += 1))
|
||||
done
|
||||
# shellcheck disable=2059
|
||||
printf -v "$1[0]" "$(ujoin "$1")" # inefficient I'm sure
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue