refactor: Clarify why assets is constructed as an array

This commit is contained in:
Felix Kröner 2024-12-08 22:58:04 +01:00
parent 4308ed0075
commit 36620ac8b8

View file

@ -43,7 +43,10 @@ ensure_tag() {
} }
upload_release() { upload_release() {
local assets=() # Array over string to resolve SC2086, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions # assets is defined as a list of arguments, where values may contain whitespace and need to be quoted like this -a "my file.txt" -a "file.txt".
# It is expanded using "${assets[@]}" which preserves the separation of arguments and not split whitespace containing values.
# For reference, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions
local assets=()
for file in "$RELEASE_DIR"/*; do for file in "$RELEASE_DIR"/*; do
assets=("${assets[@]}" -a "$file") assets=("${assets[@]}" -a "$file")
done done